From 0c79c7a509cd142358e1f80c4d546d8ae649c8bc Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Mon, 1 Mar 2010 02:21:08 +0000 Subject: [PATCH] db update git-svn-id: http://www.observium.org/svn/observer/trunk@980 61d68cd4-352d-0410-923a-c4978735b2b8 --- database-update.sql | 3 ++- discovery.php | 3 +-- includes/discovery/functions.inc.php | 6 +++--- includes/polling/device-junose.inc.php | 3 +++ 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/database-update.sql b/database-update.sql index 937f29856..fb7ad26b5 100644 --- a/database-update.sql +++ b/database-update.sql @@ -117,4 +117,5 @@ ALTER TABLE `storage` ADD `storage_free` INT NOT NULL AFTER `storage_used`; ALTER TABLE `storage` CHANGE `storage_size` `storage_size` BIGINT NOT NULL ,CHANGE `storage_used` `storage_used` BIGINT NOT NULL ,CHANGE `storage_free` `storage_free` BIGINT NOT NULL; ALTER TABLE `mempools` CHANGE `mempool_used` `mempool_used` BIGINT( 20 ) NOT NULL , CHANGE `mempool_free` `mempool_free` BIGINT( 20 ) NOT NULL ,CHANGE `mempool_total` `mempool_total` BIGINT( 20 ) NOT NULL ,CHANGE `mempool_largestfree` `mempool_largestfree` BIGINT( 20 ) NULL DEFAULT NULL ,CHANGE `mempool_lowestfree` `mempool_lowestfree` BIGINT( 20 ) NULL DEFAULT NULL; -CREATE TABLE IF NOT EXISTS `juniAtmVp` ( `juniAtmVp_id` int(11) NOT NULL, `interface_id` int(11) NOT NULL, `vp_id` int(11) NOT NULL, `vp_descr` varchar(32) NOT NULL) ENGINE=MyISAM DEFAULT CHARSET=latin1; +CREATE TABLE IF NOT EXISTS `juniAtmVp` ( `juniAtmVp_id` int(11) NOT NULL AUTO_INCREMENT, `interface_id` int(11) NOT NULL, `vp_id` int(11) NOT NULL, `vp_descr` varchar(32) NOT NULL, PRIMARY KEY (`juniAtmVp_id`)) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; + diff --git a/discovery.php b/discovery.php index bc27b8f10..287585585 100755 --- a/discovery.php +++ b/discovery.php @@ -88,7 +88,7 @@ while ($device = mysql_fetch_array($device_query)) #include("includes/discovery/os.inc.php"); include("includes/discovery/ports.inc.php"); - include("includes/discovery/entity-physical.inc.php"); +# include("includes/discovery/entity-physical.inc.php"); include("includes/discovery/processors.inc.php"); include("includes/discovery/mempools.inc.php"); include("includes/discovery/ipv4-addresses.inc.php"); @@ -103,7 +103,6 @@ while ($device = mysql_fetch_array($device_query)) include("includes/discovery/junose-atm-vp.inc.php"); include("includes/discovery/bgp-peers.inc.php"); include("includes/discovery/q-bridge-mib.inc.php"); - include("includes/discovery/cisco-vlans.inc.php"); include("includes/discovery/cisco-mac-accounting.inc.php"); include("includes/discovery/cisco-pw.inc.php"); diff --git a/includes/discovery/functions.inc.php b/includes/discovery/functions.inc.php index bd857c7a9..1691111a5 100644 --- a/includes/discovery/functions.inc.php +++ b/includes/discovery/functions.inc.php @@ -5,10 +5,10 @@ function discover_juniAtmVp(&$exists, $interface_id, $vp_id, $vp_descr) { global $config; global $debug; if (mysql_result(mysql_query("SELECT COUNT(*) FROM `juniAtmVp` WHERE `interface_id` = '".$interface_id."' AND `vp_id` = '".$vp_id."'"),0) == "0") { - echo("."); - } else { - $sql = "INSERT INTO `juniAtmVP` (`interface_id`,`vp_id`,`vp_descr`) VALUES ('".$interface_id."','".$vp_id."','".$vp_descr."')"; + $sql = "INSERT INTO `juniAtmVp` (`interface_id`,`vp_id`,`vp_descr`) VALUES ('".$interface_id."','".$vp_id."','".$vp_descr."')"; mysql_query($sql); echo("+"); if($debug) { echo($sql . " - " . mysql_affected_rows() . "inserted "); } + } else { + echo("."); } $exists[$interface_id][$vp_id] = 1; diff --git a/includes/polling/device-junose.inc.php b/includes/polling/device-junose.inc.php index bd3fc4d9a..ad7e53b67 100644 --- a/includes/polling/device-junose.inc.php +++ b/includes/polling/device-junose.inc.php @@ -27,5 +27,8 @@ $cpurrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/junose-cpu.rrd"; #$cpu_usage = trim(shell_exec($cpu_cmd)); include("hr-mib.inc.php"); +include("junose-atm-vp.inc.php"); + + ?>