From 20629c4c7dd0967deeb28b15024e9767adf945c6 Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Tue, 27 Jul 2010 16:26:39 +0000 Subject: [PATCH] fix etherlike graph for monrad, make HOST-RESOURCES-MIB discovery for cpu/mem more universal. update defaults. git-svn-id: http://www.observium.org/svn/observer/trunk@1495 61d68cd4-352d-0410-923a-c4978735b2b8 --- html/includes/graphs/port/etherlike.inc.php | 2 +- includes/defaults.inc.php | 9 ++------- includes/discovery/mempools-hrstorage.inc.php | 3 ++- includes/discovery/processors/hrdevice.inc.php | 12 ++++++------ 4 files changed, 11 insertions(+), 15 deletions(-) diff --git a/html/includes/graphs/port/etherlike.inc.php b/html/includes/graphs/port/etherlike.inc.php index 5faed2325..4e61d3b3a 100644 --- a/html/includes/graphs/port/etherlike.inc.php +++ b/html/includes/graphs/port/etherlike.inc.php @@ -2,7 +2,7 @@ ## Generate a list of ports and then call the multi_bits grapher to generate from the list -$query = mysql_query("SELECT * FROM `ports` AS I, `devices` AS D WHERE I.interface_id = '".mres($_GET['port'])."' AND I.device_id = D.device_id"); +$query = mysql_query("SELECT * FROM `ports` AS I, `devices` AS D WHERE I.interface_id = '".mres($_GET['id'])."' AND I.device_id = D.device_id"); $port = mysql_fetch_array($query); $oids = array('dot3StatsAlignmentErrors', 'dot3StatsFCSErrors', 'dot3StatsSingleCollisionFrames', 'dot3StatsMultipleCollisionFrames', diff --git a/includes/defaults.inc.php b/includes/defaults.inc.php index bd393a2f5..188f3a37c 100644 --- a/includes/defaults.inc.php +++ b/includes/defaults.inc.php @@ -180,7 +180,7 @@ $config['allow_entity_sensor']['truthvalue'] = 1; $config['allow_entity_sensor']['specialEnum'] = 1; ### Set default alert limits for various sensors and metrics - +#FIXME THESE SUCK $config['limit']['fan'] = "1000"; $config['limit']['temp'] = "60"; @@ -198,11 +198,6 @@ $config['ignore_mount_regexp'] = array("/on: \/packages/", "/on: \/dev/", "/on: $config['ignore_mount_removable'] = 1; # Ignore removable disk storage $config['ignore_mount_network'] = 1; # Ignore network mounted storage -### Poller/Discovery - -$config['enable_ports_etherlike'] = 0; # Enable EtherLike-MIB -$config['enable_ports_junoseatmvp'] = 0; # Enable JunOSe ATM VC Discovery/Poller - ### Syslog Settings $config['syslog_age'] = "1 month"; ## Entries older than this will be removed @@ -218,7 +213,7 @@ $config['auth_ldap_version'] = 3; # v2 or v3 $config['astext'][65333] = "Cymru Bogon Feed"; ### Default warning settings - +## FIXME THESE SUCK $config['defaults']['temp_limit'] = 60; ### What should we warn about? diff --git a/includes/discovery/mempools-hrstorage.inc.php b/includes/discovery/mempools-hrstorage.inc.php index 7cdbdfece..5d7283fa5 100755 --- a/includes/discovery/mempools-hrstorage.inc.php +++ b/includes/discovery/mempools-hrstorage.inc.php @@ -23,8 +23,9 @@ if(is_array($storage_array)) { if(!$deny && is_numeric($index)) { discover_mempool($valid_mempool, $device, $index, "hrstorage", $descr, $units, NULL, NULL); } - unset($deny, $fstype, $descr, $size, $used, $units, $storage_rrd, $old_storage_rrd, $storage_array); + unset($deny, $fstype, $descr, $size, $used, $units, $storage_rrd, $old_storage_rrd); } + unset($storage_array); } ?> diff --git a/includes/discovery/processors/hrdevice.inc.php b/includes/discovery/processors/hrdevice.inc.php index e9e1a83ca..6495dff69 100755 --- a/includes/discovery/processors/hrdevice.inc.php +++ b/includes/discovery/processors/hrdevice.inc.php @@ -2,12 +2,12 @@ global $valid_processor; -if ($device['os_group'] == "unix" || $device['os'] == "windows" || $device['os'] == "routeros") - { - echo("hrDevice "); - $hrDevice_oids = array('hrDevice','hrProcessorLoad'); - unset($hrDevice_array); - foreach ($hrDevice_oids as $oid) { $hrDevice_array = snmpwalk_cache_oid($device, $oid, $hrDevice_array, "HOST-RESOURCES-MIB:HOST-RESOURCES-TYPES"); } +echo("hrDevice "); +$hrDevice_oids = array('hrDevice','hrProcessorLoad'); +unset($hrDevice_array); +foreach ($hrDevice_oids as $oid) { $hrDevice_array = snmpwalk_cache_oid($device, $oid, $hrDevice_array, "HOST-RESOURCES-MIB:HOST-RESOURCES-TYPES"); } +if(is_array($hrDevice_array)) +{ foreach($hrDevice_array[$device['device_id']] as $index => $entry) { if ($entry['hrDeviceType'] == "hrDeviceProcessor")