[-]
[+]
|
Changed |
_service:set_version:inventory-system.spec
|
|
[-]
[+]
|
Changed |
inventory-system.spec
^
|
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:inventory-system-0.0.rev1510.tar.bz2/client/inventory-system.sh
^
|
@@ -132,9 +132,9 @@
# get system cpu type
function get_system_cpu {
- CPU=`${LSHW} -quiet -C processor | ${GREP} "version:" | ${AWK} -F"version: " '{ print $NF}' | ${SED} -e 's@\s\+@ @g'`
+ CPU=`${LSHW} -quiet -C processor | ${GREP} "version:" | ${SORT} -u | ${AWK} -F"version: " '{ print $NF}' | ${SED} -e 's@\s\+@ @g'`
if [ "${CPU}" == "" ] || [ "`get_system_type`" == "vmware" ]; then
- CPU=`${LSHW} -quiet -C processor | ${GREP} "product:" | ${AWK} -F"product: " '{ print $NF}' | ${SED} -e 's@\s\+@ @g'`
+ CPU=`${LSHW} -quiet -C processor | ${GREP} "product:" | ${SORT} -u | ${AWK} -F"product: " '{ print $NF}' | ${SED} -e 's@\s\+@ @g'`
fi
debug "SYSTEM-CPU: ${CPU}"
echo ${CPU}
@@ -148,7 +148,7 @@
INSTMEM=`${CAT} /proc/meminfo | ${GREP} "^MemTotal:" | ${AWK} '{print int($2/1024)}'`
;;
*)
- for MODULE in `${DMIDECODE} -t memory | ${GREP} "^\s*Size" | ${GREP} -iv "No Module Installed" | ${AWK} '{print $(NF-1)}'`
+ for MODULE in `${DMIDECODE} -t memory | ${GREP} "\s*Size" | ${GREP} -iv "No Module Installed" | ${AWK} '{print $(NF-1)}'`
do
INSTMEM=`${EXPR} ${INSTMEM} + ${MODULE}`
done
|
[-]
[+]
|
Added |
_service:recompress:tar_scm:inventory-system-0.0.rev1510.tar.bz2/server/status.php
^
|
@@ -0,0 +1,72 @@
+<?php
+/*
+// isdf - inventory system webstatus
+// Author: Carsten Schoene
+//
+// $LastChangedDate$
+// $Rev$
+*/
+
+// define our name
+define('MYNAME', "isdf");
+// open syslog connection
+openlog(MYNAME,LOG_PID | LOG_ODELAY,LOG_MAIL);
+
+// check for required extensions
+if ( ! extension_loaded("mysql") ) {
+ if ( ! dl("mysql") ) {
+ syslog(LOG_ERR,"mysql extension not loaded!");
+ exit;
+ }
+}
+
+// load additional files
+define('BASE',dirname(__FILE__));
+require_once("MDB2.php");
+require_once(BASE . "/config.inc.php");
+
+echo '<html><head>
+<title>inventory system - status web</title>
+</head>
+<body>
+<form action="' . $_SERVER['PHP_SELF'] . '">
+Select server UUID:
+<select name="systemid" onChange="javascript:document.systemid.submit()">
+';
+// create database connection
+$dbh =& MDB2::singleton($config['isdf']['db'], $config['mdb2']['options'] );
+
+$uuidsql = "SELECT id,system_uuid FROM inv_system";
+$res = $dbh->query($uuidsql);
+if (PEAR::isError($res)) {
+ syslog(LOG_ERR, "MDB2: " . $res->getMessage());
+} else {
+ while (( $row = $res->fetchRow(MDB2_FETCHMODE_ASSOC) )) {
+
+ echo '<option value="' . $row['id'] . '">' . $row['system_uuid'] . '</option>';
+ }
+}
+echo '
+</select><input type="submit" value="Select"></form>
+';
+
+if ( isset($_GET['systemid']) ) {
+ $systemid = $_GET['systemid'];
+ $datasql = "SELECT datakey, value FROM inv_system_properties WHERE inv_system_id = '$systemid'";
+
+ $datares = $dbh->query($datasql);
+ if (PEAR::isError($datares)) {
+ syslog(LOG_ERR, "MDB2: " . $datares->getMessage());
+ } else {
+ echo '<table>';
+ echo '<tr><th>Key:</th><th>Value:</th></tr>';
+ while (( $row = $datares->fetchRow(MDB2_FETCHMODE_ASSOC) )) {
+ echo '<tr><td valign="top">' . $row['datakey'] . '</td><td>' . $row['value'] . '</td></tr>';
+ }
+ echo '</table>';
+ }
+
+}
+echo '</body></html>';
+$dbh->disconnect();
+?>
|