@@ -1,8 +1,8 @@
#!/bin/bash
# Inventory System
# Author: Carsten Schoene
-# $LastChangedDate: 2012-11-07 19:39:32 +0100 (Wed, 07 Nov 2012) $
-# $Rev: 4264 $
+# $LastChangedDate: 2012-11-07 20:11:02 +0100 (Wed, 07 Nov 2012) $
+# $Rev: 4265 $
#
# Default options (can be changed by inventory-system.conf)
DEBUG="yes"
@@ -230,14 +230,6 @@
echo ${UUID}
}
-# read serialnumber / service tag with dmidecode
-function get_system_serial {
- [ "`is_disabled $FUNCNAME`" == "1" ] && return
- SYSSERIAL=`${DMIDECODE} -s system-serial-number`
- debug "SYSTEM-SERIAL: ${SYSSERIAL}"
- echo ${SYSSERIAL}
-}
-
# get list of MAC addresses from lshw
function get_system_macs {
[ "`is_disabled $FUNCNAME`" == "1" ] && return
@@ -277,6 +269,21 @@
fi
}
+# read serialnumber / service tag with dmidecode
+function get_system_serial {
+ [ "`is_disabled $FUNCNAME`" == "1" ] && return
+ case `get_system_type` in
+ xen-dom0|baremetal)
+ SYSSERIAL=`${DMIDECODE} -s system-serial-number`
+ ;;
+ *)
+ SYSSERIAL="n/a"
+ ;;
+ esac
+ debug "SYSTEM-SERIAL: ${SYSSERIAL}"
+ echo ${SYSSERIAL}
+}
+
# get system cpu type
function get_system_cpu {
[ "`is_disabled $FUNCNAME`" == "1" ] && return
@@ -393,7 +400,14 @@
# get product name
function get_system_productname {
[ "`is_disabled $FUNCNAME`" == "1" ] && return
- PRODNAME=`${DMIDECODE} -s system-product-name`
+ case `get_system_type` in
+ xen-dom0|baremetal)
+ PRODNAME=`${DMIDECODE} -s system-product-name`
+ ;;
+ *)
+ PRODNAME="n/a"
+ ;;
+ esac
debug "SYSTEM-PRODUCTNAME: ${PRODNAME}"
echo ${PRODNAME}
}
@@ -401,7 +415,14 @@
# get system vendor
function get_system_manufacturer {
[ "`is_disabled $FUNCNAME`" == "1" ] && return
- SYSMANUF=`${DMIDECODE} -s system-manufacturer`
+ case `get_system_type` in
+ xen-dom0|baremetal)
+ SYSMANUF=`${DMIDECODE} -s system-manufacturer`
+ ;;
+ *)
+ SYSMANUF="n/a"
+ ;;
+ esac
debug "SYSTEM-MANUFACTURER: ${SYSMANUF}"
echo ${SYSMANUF}
}
@@ -421,7 +442,14 @@
# get system bios version
function get_system_biosversion {
[ "`is_disabled $FUNCNAME`" == "1" ] && return
- BIOSV=`${DMIDECODE} -s bios-version`
+ case `get_system_type` in
+ xen-dom0|baremetal)
+ BIOSV=`${DMIDECODE} -s bios-version`
+ ;;
+ *)
+ BIOSV="n/a"
+ ;;
+ esac
debug "BIOS-VERSION: ${BIOSV}"
echo ${BIOSV}
}
|