From 1c70cab04719d91c7c9f4fd7fad45e5b6a0a6418 Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Thu, 25 Feb 2010 01:30:07 +0000 Subject: [PATCH] junos mempools git-svn-id: http://www.observium.org/svn/observer/trunk@949 61d68cd4-352d-0410-923a-c4978735b2b8 --- database-update.sql | 2 ++ html/includes/print-interface.inc.php | 10 +++++++- includes/defaults.inc.php | 4 +++ includes/discovery/mempools-junos.inc.php | 29 ++++++++++++++++++++++ includes/discovery/mempools.inc.php | 1 + includes/polling/mempools-junos.inc.php | 19 ++++++++++++++ includes/polling/mempools.inc.php | 5 ++-- includes/polling/storage-hrstorage.inc.php | 2 -- 8 files changed, 67 insertions(+), 5 deletions(-) create mode 100755 includes/discovery/mempools-junos.inc.php create mode 100755 includes/polling/mempools-junos.inc.php diff --git a/database-update.sql b/database-update.sql index 8a0b68b30..07459b1dd 100644 --- a/database-update.sql +++ b/database-update.sql @@ -115,3 +115,5 @@ ALTER TABLE `storage` CHANGE `storage_id` `storage_id` INT( 11 ) NOT NULL AUTO_I ALTER TABLE `storage` ADD `storage_mib` VARCHAR( 16 ) NOT NULL AFTER `device_id`; 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; diff --git a/html/includes/print-interface.inc.php b/html/includes/print-interface.inc.php index 136b4ecc7..a49954325 100644 --- a/html/includes/print-interface.inc.php +++ b/html/includes/print-interface.inc.php @@ -207,7 +207,15 @@ echo(""); echo(""); // If we're showing graphs, generate the graph and print the img tags - if($graph_type && is_file($config['rrd_dir'] . "/" . $device['hostname'] . "/". safename($interface['ifIndex'] . ".rrd"))) { + + if($graph_type == "etherlike") + { + $graph_file = $config['rrd_dir'] . "/" . $device['hostname'] . "/etherlike-". safename($interface['ifIndex']) . ".rrd"; + } else { + $graph_file = $config['rrd_dir'] . "/" . $device['hostname'] . "/". safename($interface['ifIndex']) . ".rrd"; + } + + if($graph_type && is_file($graph_file)) { $type = $graph_type; diff --git a/includes/defaults.inc.php b/includes/defaults.inc.php index e6cfae021..27a85983a 100644 --- a/includes/defaults.inc.php +++ b/includes/defaults.inc.php @@ -96,4 +96,8 @@ $config['ignore_mount_removable'] = 1; # Ignore removable disk storage $config['ignore_mount_network'] = 1; # Ignore network mounted storage $config['ignore_junos_os_drives'] = array("/on: \/packages/", "/on: \/dev/", "/on: \/proc/"); # Ignore JunOS partitions who are always 100% +# Ports + +$config['enable_ports_etherlike'] = 0; # Enable EtherLike-MIB + ?> diff --git a/includes/discovery/mempools-junos.inc.php b/includes/discovery/mempools-junos.inc.php new file mode 100755 index 000000000..598903159 --- /dev/null +++ b/includes/discovery/mempools-junos.inc.php @@ -0,0 +1,29 @@ + $entry) { + if($entry['jnxOperatingDRAMSize'] && !strpos($entry['jnxOperatingDescr'], "sensor") && !strstr($entry['jnxOperatingDescr'], "fan")) { + if ($debug) { echo($index . " " . $entry['jnxOperatingDescr'] . " -> " . $entry['jnxOperatingBuffer'] . " -> " . $entry['jnxOperatingDRAMSize'] . "\n"); } + $usage_oid = ".1.3.6.1.4.1.2636.3.1.13.1.8." . $index; + $descr = $entry['jnxOperatingDescr']; + $usage = $entry['jnxOperatingBuffer']; + if(!strstr($descr, "No") && !strstr($usage, "No") && $descr != "" ) { + discover_mempool($valid_mempool, $device, $index, "junos", $descr, "1", NULL, NULL); + } + } ## End if checks + } ## End Foreach + } ## End if array +} ## End JUNOS mempools + + unset ($mempools_array); + +?> diff --git a/includes/discovery/mempools.inc.php b/includes/discovery/mempools.inc.php index 8c6255342..db0329cc6 100755 --- a/includes/discovery/mempools.inc.php +++ b/includes/discovery/mempools.inc.php @@ -3,6 +3,7 @@ echo("Memory : "); include("mempools-cmp.inc.php"); +include("mempools-junos.inc.php"); include("mempools-ironware-dyn.inc.php"); ### Remove memory pools which weren't redetected here diff --git a/includes/polling/mempools-junos.inc.php b/includes/polling/mempools-junos.inc.php new file mode 100755 index 000000000..13bb43657 --- /dev/null +++ b/includes/polling/mempools-junos.inc.php @@ -0,0 +1,19 @@ + diff --git a/includes/polling/mempools.inc.php b/includes/polling/mempools.inc.php index 728650086..7e73b99a0 100755 --- a/includes/polling/mempools.inc.php +++ b/includes/polling/mempools.inc.php @@ -1,5 +1,7 @@