From 3281e71a9ac6771470fec30c06a1b614e18fc8da Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Fri, 12 Mar 2010 17:18:04 +0000 Subject: [PATCH] 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 --- database-update.sql | 5 +++++ includes/discovery/functions.inc.php | 1 - includes/discovery/mempools-cemp.inc.php | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/database-update.sql b/database-update.sql index 96d3c25daa..ae9841e4a1 100644 --- a/database-update.sql +++ b/database-update.sql @@ -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`; diff --git a/includes/discovery/functions.inc.php b/includes/discovery/functions.inc.php index 7f062c7f8b..1580026b72 100644 --- a/includes/discovery/functions.inc.php +++ b/includes/discovery/functions.inc.php @@ -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"; } } diff --git a/includes/discovery/mempools-cemp.inc.php b/includes/discovery/mempools-cemp.inc.php index 8d7f5245c6..55ce29ee50 100755 --- a/includes/discovery/mempools-cemp.inc.php +++ b/includes/discovery/mempools-cemp.inc.php @@ -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); } }