[-]
[+]
|
Changed |
inventory-system.changes
|
|
[-]
[+]
|
Changed |
_service:set_version:inventory-system.spec
^
|
|
[-]
[+]
|
Changed |
inventory-system.spec
^
|
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:inventory-system-0.0.8033.tar.bz2/server/config.inc.php
^
|
@@ -1,6 +1,6 @@
<?php
-$config["isdf"]["postvars"] = array("get_system_uuid","get_system_serial","get_system_cpu","get_system_memory","get_system_manufacturer","get_system_productname","get_system_biosversion","get_system_net_info","get_system_default_ip","get_system_ipv4","get_system_ipv6","get_system_hostname","get_system_mgmt_mac","get_system_mgmt_ip","get_system_mgmt_firmware","get_system_type","get_system_kernelversion","get_system_arch","get_system_os","get_system_software","get_system_date","get_system_disk_size_bootdev","get_system_disk_sizes","get_system_dell_express_service_code","get_baseboard_manufacturer","get_baseboard_productname");
+$config["isdf"]["postvars"] = array("get_system_uuid","get_system_serial","get_system_cpu","get_system_memory","get_system_manufacturer","get_system_productname","get_system_biosversion","get_system_net_info","get_system_default_ip","get_system_ipv4","get_system_ipv6","get_system_hostname","get_system_mgmt_mac","get_system_mgmt_ip","get_system_mgmt_firmware","get_system_type","get_system_kernelversion","get_system_arch","get_system_os","get_system_software","get_system_date","get_system_disk_size_bootdev","get_system_disk_sizes","get_system_dell_express_service_code","get_baseboard_manufacturer","get_baseboard_productname","get_system_virtual_guests");
$config["isdf"]["dhcp"]["macblacklist"] = array("00:00:00:00:00:00","ff:ff:ff:ff:ff:ff");
$config["isdf"]["dhcp"]["intblacklist"] = array("virbr0");
|
[-]
[+]
|
Changed |
_service:set_version:inventory-system.dsc
^
|
@@ -2,7 +2,7 @@
Source: inventory-system
Binary: inventory-system
Architecture: any
-Version: 0.0.8032
+Version: 0.0.8033
Maintainer: Carsten Schoene <cs@linux-administrator.com>
Standards-Version: 0.0.1
Build-Depends: cdbs, cmake, debhelper
|
[-]
[+]
|
Changed |
addon-functions.sh
^
|
@@ -1,5 +1,6 @@
# get OS image setup type
function get_system_type_osimage {
+ [ "`is_disabled $FUNCNAME`" == "1" ] && return
if [ -f /etc/system-image.conf ] ; then
. /etc/system-image.conf
else
|
[-]
[+]
|
Changed |
debian.rules
^
|
@@ -46,6 +46,7 @@
install -D -m644 ../SOURCES/inventory-system.conf $(DESTDIR)/etc/inventory-system.conf
install -D -m755 ../SOURCES/addon-functions.sh $(DESTDIR)/etc/inventory-system.d/addon-functions.sh
install -D -m755 ../SOURCES/mainboard-functions.sh $(DESTDIR)/etc/inventory-system.d/mainboard-functions.sh
+ install -D -m755 ../SOURCES/vm-functions.sh $(DESTDIR)/etc/inventory-system.d/vm-functions.sh
# --- end custom part for installing
# Build architecture-independent files here.
|
[-]
[+]
|
Changed |
inventory-system.conf
^
|
@@ -22,7 +22,7 @@
## Type: string
## Default: ""
#
-CUSTOM_FUNCTIONS="get_system_type_osimage get_baseboard_manufacturer get_baseboard_productname"
+CUSTOM_FUNCTIONS="get_system_type_osimage get_baseboard_manufacturer get_baseboard_productname get_system_virtual_guests"
#
## Description: Disable listed functions (space separated)
## Type: string
|
[-]
[+]
|
Changed |
mainboard-functions.sh
^
|
@@ -1,13 +1,29 @@
# get mainboard manufacturer
function get_baseboard_manufacturer {
- BMANUF=`${DMIDECODE} -s baseboard-manufacturer`
- debug "BASEBOARD-MANUFACTURER: ${BMANUF}"
- echo ${BMANUF}
+ [ "`is_disabled $FUNCNAME`" == "1" ] && return
+ case `get_system_type` in
+ xen-dom0|baremetal)
+ BMANUF=`${DMIDECODE} -s baseboard-manufacturer`
+ ;;
+ *)
+ BMANUF=""
+ ;;
+ esac
+ debug "BASEBOARD-MANUFACTURER: ${BMANUF}"
+ echo ${BMANUF}
}
-#get mainboard product name
+# get mainboard product name
function get_baseboard_productname {
- BPROD=`${DMIDECODE} -s baseboard-product-name`
- debug "BASEBOARD-PRODUCT-NAME: ${BPROD}"
- echo ${BPROD}
+ [ "`is_disabled $FUNCNAME`" == "1" ] && return
+ case `get_system_type` in
+ xen-dom0|baremetal)
+ BPROD=`${DMIDECODE} -s baseboard-product-name`
+ ;;
+ *)
+ BPROD=""
+ ;;
+ esac
+ debug "BASEBOARD-PRODUCT-NAME: ${BPROD}"
+ echo ${BPROD}
}
|
[-]
[+]
|
Added |
vm-functions.sh
^
|
@@ -0,0 +1,32 @@
+# get list of virtual machines
+function get_system_virtual_guests {
+ [ "`is_disabled $FUNCNAME`" == "1" ] && return
+ CMDS="virsh xm xe"
+ for CMD in ${CMDS} ; do
+ CMDNAME=`echo ${CMD} | awk '{print toupper($1) }' | sed -e s@"-"@""@g`
+ export $(eval "echo ${CMDNAME}")=`which ${CMD} 2>/dev/null`
+ if [ -z "${!CMDNAME}" ] ; then
+ debug "Command: ${CMD} not found!"
+ else
+ debug "Found command $(echo $CMDNAME) in ${!CMDNAME}"
+ fi
+ done
+ case `get_system_type` in
+ xen-dom0|baremetal)
+ if [ -n "${VIRSH}" ] ; then
+ VMS=`${VIRSH} -q list | ${GREP} -v Domain-0 | ${AWK} '{print $2}' | ${SORT} -u`
+ elif [ -n "${XM}" ] ; then
+ VMS=`${XM} list | ${GREP} -v -E '(^Name|^Domain-0)' | ${AWK} '{print $1}' | ${SORT} -u`
+ elif [ -n "${XE}" ] ; then
+ VMS=`${XE} vm-list is-control-domain=false params=name-label | ${AWK} '{print $NF}'| ${GREP} -v ^$ | ${SORT} -u`
+ else
+ VMS=""
+ fi
+ ;;
+ *)
+ VMS=""
+ ;;
+ esac
+ debug "GET-SYSTEM-VIRTUAL-GUESTS: ${VMS}"
+ echo "${VMS}"
+}
|