[-]
[+]
|
Changed |
_service:set_version:ix-inventory-system.spec
|
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:inventory-system-0.0.rev1626.tar.bz2/client/inventory-system.sh
^
|
@@ -1,8 +1,8 @@
#!/bin/bash
# Inventory System
# Author: Carsten Schoene
-# $LastChangedDate: 2012-07-10 16:33:56 +0200 (Tue, 10 Jul 2012) $
-# $Rev: 1541 $
+# $LastChangedDate: 2012-07-21 12:34:40 +0200 (Sat, 21 Jul 2012) $
+# $Rev: 1626 $
#
# Default options (can be changed by inventory-system.conf)
DEBUG="yes"
@@ -36,8 +36,13 @@
rpm
ls
date
+modprobe
+ipmitool
"
+# clean old logfile
+rm -f /tmp/inventory-system.log
+
# mail alerts / debug messages
function mailalerts {
if [ -s /tmp/inventory-system.log ] ; then
@@ -125,7 +130,7 @@
if [ "${TYPE}" == "" ] ; then
TYPE="baremetal"
fi
- debug "SYSTEM-TYOE: ${TYPE}"
+ debug "SYSTEM-TYPE: ${TYPE}"
echo ${TYPE}
else
debug "VIRT-WHAT ERROR: ${RETVAL}"
@@ -253,6 +258,59 @@
get_system_default_interface_ip_from_int `get_system_default_interface`
}
+# get ipmi mac
+function get_system_mgmt_mac {
+ case `get_system_type` in
+ xen-dom0|baremetal)
+ ${MODPROBE} ipmi_devintf >/dev/null 2>&1
+ ${MODPROBE} ipmi_si >/dev/null 2>&1
+ if [ $? == 0 ] ; then
+ ${IPMITOOL} lan print 1 >/dev/null 2>&1
+ if [ $? == 0 ] ; then
+ MAC=`${IPMITOOL} lan print 1 | ${GREP} -E '(^MAC Address)' | ${AWK} '{print tolower($NF)}' | \
+ ${GREP} -i -E '([0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2})'`
+ fi
+ if [ -z "${MAC}" ] ; then
+ MAC="none"
+ fi
+ else
+ MAC="none"
+ fi
+ ;;
+ *)
+ MAC="none"
+ ;;
+ esac
+ debug "SYSTEM-MGMT-MAC: ${MAC}"
+ echo ${MAC}
+}
+
+# get ipmi ip
+function get_system_mgmt_ip {
+ case `get_system_type` in
+ xen-dom0|baremetal)
+ ${MODPROBE} ipmi_devintf >/dev/null 2>&1
+ ${MODPROBE} ipmi_si >/dev/null 2>&1
+ if [ $? == 0 ] ; then
+ ${IPMITOOL} lan print 1 >/dev/null 2>&1
+ if [ $? == 0 ] ; then
+ MGMTIP=`${IPMITOOL} lan print 1 | ${GREP} -E '(^IP Address) ' | ${AWK} '{print $NF}'`
+ fi
+ if [ -z "${MGMTIP}" ] ; then
+ MGMTIP="none"
+ fi
+ else
+ MGMTIP="none"
+ fi
+ ;;
+ *)
+ MGMTIP="none"
+ ;;
+ esac
+ debug "SYSTEM-MGMT-IP: ${MGMTIP}"
+ echo ${MGMTIP}
+}
+
# get rpm package list
function get_system_software {
PACKAGES=`${RPM} -qa --queryformat '%{name}-%{version}-%{release}.%{arch} '`
@@ -322,6 +380,8 @@
get_system_ipv4 \
get_system_ipv6 \
get_system_hostname \
+ get_system_mgmt_mac \
+ get_system_mgmt_ip \
get_system_type \
get_system_kernelversion \
get_system_arch \
|
[-]
[+]
|
Added |
_service:recompress:tar_scm:inventory-system-0.0.rev1626.tar.bz2/server/config-custom.inc.php
^
|
@@ -0,0 +1,5 @@
+<?php
+
+$config["isdf"]["custom_postvars"] = array();
+
+?>
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:inventory-system-0.0.rev1626.tar.bz2/server/config.inc.php
^
|
@@ -1,17 +1,5 @@
<?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_type","get_system_kernelversion","get_system_arch","get_system_os","get_system_software","get_system_date");
-
-$config["isdf"]["custom_postvars"] = array();
-
-$config["isdf"]["db"]['phptype'] = "mysql";
-$config["isdf"]["db"]['protocol'] = "tcp";
-$config["isdf"]["db"]['hostspec'] = "";
-$config["isdf"]["db"]['database'] = "";
-$config["isdf"]["db"]['username'] = "";
-$config["isdf"]["db"]['password'] = "";
-$config["isdf"]["db"]['new_link'] = true;
-$config['mdb2']['options'] = array();
-
+$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_type","get_system_kernelversion","get_system_arch","get_system_os","get_system_software","get_system_date");
?>
|
[-]
[+]
|
Added |
_service:recompress:tar_scm:inventory-system-0.0.rev1626.tar.bz2/server/db.inc.php
^
|
@@ -0,0 +1,12 @@
+<?php
+
+$config["isdf"]["db"]['phptype'] = "mysql";
+$config["isdf"]["db"]['protocol'] = "tcp";
+$config["isdf"]["db"]['hostspec'] = "";
+$config["isdf"]["db"]['database'] = "";
+$config["isdf"]["db"]['username'] = "";
+$config["isdf"]["db"]['password'] = "";
+$config["isdf"]["db"]['new_link'] = true;
+$config['mdb2']['options'] = array();
+
+?>
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:inventory-system-0.0.rev1626.tar.bz2/server/isdf.php
^
|
@@ -3,8 +3,8 @@
// isdf - inventory system deployment feed
// Author: Carsten Schoene
//
-// $LastChangedDate: 2012-07-06 21:46:15 +0200 (Fri, 06 Jul 2012) $
-// $Rev: 1530 $
+// $LastChangedDate: 2012-07-20 21:09:25 +0200 (Fri, 20 Jul 2012) $
+// $Rev: 1619 $
*/
// define our name
@@ -24,6 +24,8 @@
define('BASE',dirname(__FILE__));
require_once("MDB2.php");
require_once(BASE . "/config.inc.php");
+require_once(BASE . "/config-custom.inc.php");
+require_once(BASE . "/db.inc.php");
// initialize variables
$request_complete=1;
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:inventory-system-0.0.rev1626.tar.bz2/server/status.php
^
|
@@ -3,8 +3,8 @@
// isdf - inventory system webstatus
// Author: Carsten Schoene
//
-// $LastChangedDate: 2012-07-07 20:43:56 +0200 (Sat, 07 Jul 2012) $
-// $Rev: 1533 $
+// $LastChangedDate: 2012-07-20 21:09:25 +0200 (Fri, 20 Jul 2012) $
+// $Rev: 1619 $
*/
// define our name
@@ -24,6 +24,8 @@
define('BASE',dirname(__FILE__));
require_once("MDB2.php");
require_once(BASE . "/config.inc.php");
+require_once(BASE . "/config-custom.inc.php");
+require_once(BASE . "/db.inc.php");
echo '<html><head>
<title>inventory system - status web</title>
|