some db cleanups and removal of debugging and cleanup of processor descriptions

git-svn-id: http://www.observium.org/svn/observer/trunk@1012 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2010-03-12 17:18:04 +00:00
parent 950cf4e7a4
commit 3281e71a9a
3 changed files with 9 additions and 1 deletions

View File

@@ -1 +1,6 @@
CREATE TABLE IF NOT EXISTS `toner` ( `toner_id` int(11) NOT NULL auto_increment, `device_id` int(11) NOT NULL default '0', `toner_index` int(11) NOT NULL, `toner_type` varchar(64) NOT NULL, `toner_oid` varchar(64) NOT NULL, `toner_descr` varchar(32) NOT NULL default '', `toner_capacity` int(11) NOT NULL default '0', `toner_current` int(11) NOT NULL default '0', PRIMARY KEY (`toner_id`), KEY `device_id` (`device_id`)) ENGINE=InnoDB DEFAULT CHARSET=latin1;
ALTER TABLE `mempools` CHANGE `mempool_descr` `mempool_descr` VARCHAR( 64 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL;
ALTER TABLE `processors` CHANGE `processor_descr` `processor_descr` VARCHAR( 64 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL;
DROP TABLE `cempMemPool`;
DROP TABLE `cpmCPU`;
DROP TABLE `cmpMemPool`;

View File

@@ -128,7 +128,6 @@ function discover_mempool(&$valid_mempool, $device, $index, $type, $descr, $prec
echo(".");
# entry = mysql_fetch_assoc(mysql_query());
$query = "UPDATE `mempools` SET `mempool_descr` = '".$descr."', `entPhysicalIndex` = '$entPhysicalIndex', `hrDeviceIndex` = '$hrDeviceIndex' WHERE `device_id` = '".$device['device_id']."' AND `mempool_index` = '".$index."' AND `mempool_type` = '".$type."'";
echo("$query");
mysql_query($query);
if($debug) { print $query . "\n"; }
}

View File

@@ -12,6 +12,10 @@ if($device['os'] == "ios" || $device['os_type'] == "ios") {
list($entPhysicalIndex) = explode(".", $index);
$entPhysicalDescr = snmp_get($device, "entPhysicalDescr.".$entPhysicalIndex, "-Oqv", "ENTITY-MIB");
$descr = $entPhysicalDescr." - ".$entry['cempMemPoolName'];
$descr = str_replace("Cisco ", "", $descr);
$descr = str_replace("Network Processing Engine", "", $descr);
discover_mempool($valid_mempool, $device, $index, "cemp", $descr, "1", $entPhysicalIndex, NULL);
}
}