Changes of Revision 22
[-] | Changed | _service:set_version:ix-inventory-system.spec |
1
2 %define pkgname inventory-system 3 Name: ix-inventory-system 4 Release: 0 5 -Version: 0.0.rev4314 6 +Version: 0.0.rev4323 7 Url: http://www.internetx.com/ 8 License: GPLv2 9 Group: System 10 |
||
[+] | Added | _service:recompress:tar_scm:inventory-system-0.0.rev4323.tar.bz2/SUPPORTED_OS ^ |
@@ -0,0 +1,13 @@ +* client side tested operating systems +CentOS 5.x +CentOS 6.x +Citrix XenServer 6.x +RHEL 5.x +RHEL 6.x +SUSE Linux Enterprise 10 +SUSE Linux Enterprise 11 +openSUSE 12.1 +openSUSE 12.2 + +* server side tested operating systems +SUSE Linux Enterprise 11 | ||
[+] | Added | _service:recompress:tar_scm:inventory-system-0.0.rev4323.tar.bz2/TODO ^ |
@@ -0,0 +1,19 @@ +* Debian / Ubuntu support: + +- needed Debian 6 packages: + uuid-runtime + virt-what >= 1.12-1 (needs package build with symlink from virt-what to virtwhat) + ipmitool + lsb-release + ethtool + lshw >= 02.16-1 (needs package build, because 02.14-1 of Debian 6 is buggy) + dmidecode + +- package requirements in script + - either remove rpm from list or split (out) for rpm and deb based systems + +- autoupdater +- get_system_software +- get_system_memory (needs check, test returned 0 as value) + +- build a .deb package | ||
[+] | Changed | _service:recompress:tar_scm:inventory-system-0.0.rev4323.tar.bz2/client/inventory-system.sh ^ |
@@ -1,8 +1,8 @@ #!/bin/bash # Inventory System # Author: Carsten Schoene -# $LastChangedDate: 2012-11-10 19:24:55 +0100 (Sat, 10 Nov 2012) $ -# $Rev: 4314 $ +# $LastChangedDate: 2012-11-10 21:34:25 +0100 (Sat, 10 Nov 2012) $ +# $Rev: 4316 $ # # Default options (can be changed by inventory-system.conf) DEBUG="yes" @@ -508,7 +508,7 @@ # get hostname function get_system_hostname { [ "`is_disabled $FUNCNAME`" == "1" ] && return - HN=`${HOSTNAME} -f` + HN=`${HOSTNAME} -f 2>/dev/null` if [ -z "${HN}" ] ; then if [ -s /etc/sysconfig/network ] ; then HN=`${CAT} /etc/sysconfig/network | ${GREP} ^HOSTNAME | ${AWK} -F= '{print $NF}'` | ||
[+] | Changed | _service:recompress:tar_scm:inventory-system-0.0.rev4323.tar.bz2/server/client-status.php ^ |
@@ -3,8 +3,8 @@ // isdf - inventory system search // Author: Carsten Schoene // -// $LastChangedDate: 2012-07-20 21:09:25 +0200 (Fr, 20. Jul 2012) $ -// $Rev: 1619 $ +// $LastChangedDate: 2012-11-12 10:39:18 +0100 (Mon, 12 Nov 2012) $ +// $Rev: 4323 $ */ // define our name @@ -35,6 +35,27 @@ // create database connection $dbh =& MDB2::singleton($config['isdf']['db'], $config['mdb2']['options'] ); +if ( isset($_POST['delete']) && isset($_POST['inv_system_id'] )) { + $inv_id = (int)trim($_POST['inv_system_id']); + if ( is_int($inv_id) ) { + $inv_id = $dbh->escape($inv_id); + + $delqry = "DELETE FROM inv_system_properties WHERE inv_system_id = '$inv_id'"; + $delres = $dbh->exec($delqry); + if (PEAR::isError($delres)) { + syslog(LOG_ERR, "MDB2 delres: " . $delres->getMessage() . "Query was: " .$delqry); + } else { + $delqry2 = "DELETE FROM inv_system WHERE id = '$inv_id'"; + $delres2 = $dbh->exec($delqry2); + if (PEAR::isError($delres2)) { + syslog(LOG_ERR, "MDB2 delres2: " . $delres->getMessage() . "Query was: " .$delqry2); + } + } + } else { + syslog(LOG_ERR, "inv_system_id is set, but not of type INT - Value " . $_POST['inv_system_id'] . " Type " . gettype($_POST['inv_system_id'])); + } +} + $datasql = "SELECT inv_system_id, datakey, value FROM inv_system_properties WHERE (datakey = 'get_system_uuid' OR datakey = 'get_system_default_ip' OR datakey = 'get_system_hostname' OR @@ -56,14 +77,15 @@ $idrow['value'] = strtotime($idrow['value']); } //array_push($data,$idrow); + $data[$idrow['inv_system_id']]['inv_system_id'] = $idrow['inv_system_id']; $data[$idrow['inv_system_id']][$idrow['datakey']] = $idrow['value']; } } $result = array(); $ver = preg_replace('/-server/','',trim(exec("rpm -qa|grep inventory-system-server"))); $lastlogin = time() - 172800; -echo 'Server Software version: ' . $ver . ' <br/>'; -echo 'Server allowed last login: ' . $lastlogin . ' (' . date("Y-m-d H:i:s",$lastlogin) . ') <br/>'; +echo 'Server Software version: ' . $ver . ' <br/>' . "\n"; +echo 'Server allowed last login: ' . $lastlogin . ' (' . date("Y-m-d H:i:s",$lastlogin) . ') <br/>' . "\n"; foreach ( $data as $idx ) { if ( $idx['get_system_date'] < $lastlogin ) { $idx['last_login_to_old'] = 1; @@ -75,11 +97,19 @@ continue; } } -echo '<table><tr><th>Key:</th><td>Value:</th></tr>'; -echo '</table>'; -echo '<pre>'; -print_r($result); -echo '</pre>'; -echo '</body></html>'; +foreach ($result as $mkey) { + echo '<form method="POST" name="deleteform" action="' . $_SERVER['PHP_SELF'] . '">'; + echo '<table><tr><th>Key:</th><th>Value:</th><th>Action:</th></tr>' . "\n"; + foreach ( $mkey as $key => $value ) { + if ( $key == "inv_system_id" ) { + echo '<tr><td>' . $key . '</td><td>' . $value . '</td><td><input type="hidden" name="inv_system_id" value="' . $value . '"><input type="submit" name="delete" value="Delete from DB"></td></tr>' . "\n"; + } else { + echo '<tr><td>' . $key . '</td><td>' . $value . '</td><td> </td></tr>' . "\n"; + } + } + echo '</table><hr/>' . "\n"; + echo '</form>'. "\n"; +} +echo '</body></html>' . "\n"; $dbh->disconnect(); ?> |