From 0a2371cfc7e93bdc4764a9032b318b8b4d78e09d Mon Sep 17 00:00:00 2001 From: Tom Laermans Date: Mon, 14 Mar 2011 19:24:23 +0000 Subject: [PATCH] reformat mempool and current discovery git-svn-id: http://www.observium.org/svn/observer/trunk@1834 61d68cd4-352d-0410-923a-c4978735b2b8 --- includes/discovery/current/apc.inc.php | 30 ++++++------ .../discovery/current/gamatronicups.inc.php | 9 ++-- includes/discovery/current/ipoman.inc.php | 13 ++--- includes/discovery/current/mgeups.inc.php | 9 ++-- includes/discovery/current/rfc1628.inc.php | 14 ++++-- includes/discovery/current/xups.inc.php | 11 +++-- includes/discovery/mempools/cemp.inc.php | 27 +++++----- includes/discovery/mempools/cmp.inc.php | 12 ++--- .../discovery/mempools/hp-procurve.inc.php | 49 ++++++++++--------- includes/discovery/mempools/hrstorage.inc.php | 16 +++--- .../discovery/mempools/ironware-dyn.inc.php | 12 ++--- includes/discovery/mempools/junos.inc.php | 20 +++++--- includes/discovery/mempools/screenos.inc.php | 11 ++--- 13 files changed, 129 insertions(+), 104 deletions(-) diff --git a/includes/discovery/current/apc.inc.php b/includes/discovery/current/apc.inc.php index ab4e0f2fc1..4dfe087bff 100644 --- a/includes/discovery/current/apc.inc.php +++ b/includes/discovery/current/apc.inc.php @@ -12,7 +12,7 @@ if ($device['os'] == "apc") if ($oids) echo("APC "); $type = "apc"; $precision = "10"; - foreach(explode("\n", $oids) as $data) + foreach (explode("\n", $oids) as $data) { $data = trim($data); if ($data) @@ -44,24 +44,24 @@ if ($device['os'] == "apc") } } - # ATS + # ATS $atsCurrent = snmp_get($device, "1.3.6.1.4.1.318.1.1.8.5.4.3.1.4.1.1.1", "-OsqnU", ""); if ($atsCurrent) { - $current_oid = "1.3.6.1.4.1.318.1.1.8.5.4.3.1.4.1.1.1"; - $limit_oid = "1.3.6.1.4.1.318.1.1.8.4.16.1.5.1"; - $lowlimit_oid = "1.3.6.1.4.1.318.1.1.8.4.16.1.3.1"; - $warnlimit_oid = "1.3.6.1.4.1.318.1.1.8.4.16.1.4.1"; - $index = 1; + $current_oid = "1.3.6.1.4.1.318.1.1.8.5.4.3.1.4.1.1.1"; + $limit_oid = "1.3.6.1.4.1.318.1.1.8.4.16.1.5.1"; + $lowlimit_oid = "1.3.6.1.4.1.318.1.1.8.4.16.1.3.1"; + $warnlimit_oid = "1.3.6.1.4.1.318.1.1.8.4.16.1.4.1"; + $index = 1; - $current = snmp_get($device, $current_oid, "-Oqv", "") / $precision; - $limit = snmp_get($device, $limit_oid, "-Oqv", ""); # No / $precision here! Nice, APC! - $lowlimit = snmp_get($device, $lowlimit_oid, "-Oqv", ""); # No / $precision here! Nice, APC! - $warnlimit = snmp_get($device, $warnlimit_oid, "-Oqv", ""); # No / $precision here! Nice, APC! - $descr = "Output Feed"; - - echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, NULL, $warnlimit, $limit, $current)); + $current = snmp_get($device, $current_oid, "-Oqv", "") / $precision; + $limit = snmp_get($device, $limit_oid, "-Oqv", ""); # No / $precision here! Nice, APC! + $lowlimit = snmp_get($device, $lowlimit_oid, "-Oqv", ""); # No / $precision here! Nice, APC! + $warnlimit = snmp_get($device, $warnlimit_oid, "-Oqv", ""); # No / $precision here! Nice, APC! + $descr = "Output Feed"; + echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, NULL, $warnlimit, $limit, $current)); } } -?> + +?> \ No newline at end of file diff --git a/includes/discovery/current/gamatronicups.inc.php b/includes/discovery/current/gamatronicups.inc.php index a6a4810d06..04baa647eb 100644 --- a/includes/discovery/current/gamatronicups.inc.php +++ b/includes/discovery/current/gamatronicups.inc.php @@ -2,9 +2,9 @@ global $valid_sensor; -if ($device['os'] == "gamatronicups") +if ($device['os'] == "gamatronicups") { - for ($i = 1; $i <= 3; $i++) + for ($i = 1; $i <= 3; $i++) { $current_oid = "GAMATRONIC-MIB::gamatronicLTD.5.4.1.1.3.$i"; $descr = "Input Phase $i"; @@ -19,7 +19,7 @@ if ($device['os'] == "gamatronicups") echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '1', '1', $lowlimit, NULL, NULL, NULL, $current)); } - for ($i = 1; $i <= 3; $i++) + for ($i = 1; $i <= 3; $i++) { $current_oid = "GAMATRONIC-MIB::gamatronicLTD.5.5.1.1.3.$i"; $descr = "Output Phase $i"; @@ -34,4 +34,5 @@ if ($device['os'] == "gamatronicups") echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '1', '1', $lowlimit, NULL, NULL, NULL, $current)); } } -?> + +?> \ No newline at end of file diff --git a/includes/discovery/current/ipoman.inc.php b/includes/discovery/current/ipoman.inc.php index 4d47aa69e9..3c3fe93a32 100644 --- a/includes/discovery/current/ipoman.inc.php +++ b/includes/discovery/current/ipoman.inc.php @@ -7,8 +7,8 @@ if ($device['os'] == "ipoman") { echo(" IPOMANII-MIB "); - if(!is_array($cache['ipoman'])) - { + if (!is_array($cache['ipoman'])) + { echo("outletConfigDesc "); $cache['ipoman']['out'] = snmpwalk_cache_multi_oid($device, "outletConfigDesc", $cache['ipoman']['out'], "IPOMANII-MIB"); echo("outletConfigLocation "); @@ -31,9 +31,9 @@ if ($device['os'] == "ipoman") $oids_out = snmpwalk_cache_multi_oid($device, "outletStatusCurrent", $oids_out, "IPOMANII-MIB"); // $oids_out = snmpwalk_cache_multi_oid($device, "outletStatusKwatt", $oids_out, "IPOMANII-MIB"); // See above - if(is_array($oids_in)) + if (is_array($oids_in)) { - foreach($oids_in as $index => $entry) + foreach ($oids_in as $index => $entry) { $cur_oid = '.1.3.6.1.4.1.2468.1.4.2.1.3.1.3.1.3.' . $index; $divisor = 1000; @@ -45,9 +45,9 @@ if ($device['os'] == "ipoman") } } - if(is_array($oids_out)) + if (is_array($oids_out)) { - foreach($oids_out as $index => $entry) + foreach ($oids_out as $index => $entry) { $cur_oid = '.1.3.6.1.4.1.2468.1.4.2.1.3.2.3.1.3.' . $index; $divisor = 1000; @@ -58,4 +58,5 @@ if ($device['os'] == "ipoman") } } } + ?> \ No newline at end of file diff --git a/includes/discovery/current/mgeups.inc.php b/includes/discovery/current/mgeups.inc.php index c79ec34cb3..15fc7cb169 100644 --- a/includes/discovery/current/mgeups.inc.php +++ b/includes/discovery/current/mgeups.inc.php @@ -3,7 +3,7 @@ global $valid_sensor; ## MGE UPS -if ($device['os'] == "mgeups") +if ($device['os'] == "mgeups") { echo("MGE "); $oids = trim(snmp_walk($device, "1.3.6.1.4.1.705.1.7.1", "-OsqnU")); @@ -28,9 +28,10 @@ if ($device['os'] == "mgeups") $lowlimit = 0; $limit = NULL; $lowwarnlimit = NULL; - echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, $lowwarnlimit, $warnlimit, $limit, $current)); + echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, $lowwarnlimit, $warnlimit, $limit, $current)); } + $oids = trim(snmp_walk($device, "1.3.6.1.4.1.705.1.6.1", "-OsqnU")); if ($debug) { echo($oids."\n"); } $numPhase = count(explode("\n",$oids)); @@ -53,7 +54,9 @@ if ($device['os'] == "mgeups") $lowlimit = 0; $limit = NULL; $lowwarnlimit = NULL; + echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, $lowwarnlimit, $warnlimit, $limit, $current)); } } -?> + +?> \ No newline at end of file diff --git a/includes/discovery/current/rfc1628.inc.php b/includes/discovery/current/rfc1628.inc.php index 48de0914e5..4d2d80e8ec 100644 --- a/includes/discovery/current/rfc1628.inc.php +++ b/includes/discovery/current/rfc1628.inc.php @@ -3,17 +3,17 @@ global $valid_sensor; ## RFC1628 UPS -if ($device['os'] == "netmanplus" || $device['os'] == "deltaups") +if ($device['os'] == "netmanplus" || $device['os'] == "deltaups") { echo("RFC1628 "); - + $oids = snmp_walk($device, "1.3.6.1.2.1.33.1.2.6", "-Osqn", "UPS-MIB"); if ($debug) { echo($oids."\n"); } $oids = trim($oids); - foreach(explode("\n", $oids) as $data) + foreach (explode("\n", $oids) as $data) { $data = trim($data); - if ($data) + if ($data) { list($oid,$descr) = explode(" ", $data,2); $split_oid = explode('.',$oid); @@ -24,6 +24,7 @@ if ($device['os'] == "netmanplus" || $device['os'] == "deltaups") $descr = "Battery" . (count(explode("\n",$oids)) == 1 ? '' : ' ' . ($current_id+1)); $type = "rfc1628"; $index = 500+$current_id; + echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '10', '1', NULL, NULL, NULL, NULL, $current)); } } @@ -39,6 +40,7 @@ if ($device['os'] == "netmanplus" || $device['os'] == "deltaups") $type = "rfc1628"; $precision = 1; $index = $i; + echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '1', '1', NULL, NULL, NULL, NULL, $current)); } @@ -53,6 +55,7 @@ if ($device['os'] == "netmanplus" || $device['os'] == "deltaups") $type = "rfc1628"; $precision = 1; $index = 100+$i; + echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '1', '1', NULL, NULL, NULL, NULL, $current)); } @@ -67,8 +70,9 @@ if ($device['os'] == "netmanplus" || $device['os'] == "deltaups") $type = "rfc1628"; $precision = 1; $index = 200+$i; + echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '1', '1', NULL, NULL, NULL, NULL, $current)); } } -?> +?> \ No newline at end of file diff --git a/includes/discovery/current/xups.inc.php b/includes/discovery/current/xups.inc.php index 6bb35d422e..7242ac6b4a 100644 --- a/includes/discovery/current/xups.inc.php +++ b/includes/discovery/current/xups.inc.php @@ -6,14 +6,14 @@ global $valid_sensor; if ($device['os'] == "powerware") { echo("XUPS-MIB "); - + $oids = snmp_walk($device, "xupsBatCurrent", "-Osqn", "XUPS-MIB"); if ($debug) { echo($oids."\n"); } $oids = trim($oids); - foreach(explode("\n", $oids) as $data) + foreach (explode("\n", $oids) as $data) { $data = trim($data); - if ($data) + if ($data) { list($oid,$descr) = explode(" ", $data,2); $split_oid = explode('.',$oid); @@ -24,6 +24,7 @@ if ($device['os'] == "powerware") $descr = "Battery" . (count(explode("\n",$oids)) == 1 ? '' : ' ' . ($current_id+1)); $type = "xups"; $index = "1.2.3.".$current_id; + echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current)); } } @@ -39,6 +40,7 @@ if ($device['os'] == "powerware") $type = "xups"; $divisor = 1; $index = "4.4.1.3.".$i; + echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current)); } @@ -53,8 +55,9 @@ if ($device['os'] == "powerware") $type = "xups"; $divisor = 1; $index = "3.4.1.3.".$i; + echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current)); } } -?> +?> \ No newline at end of file diff --git a/includes/discovery/mempools/cemp.inc.php b/includes/discovery/mempools/cemp.inc.php index 128d4bdc48..41fc9b5109 100755 --- a/includes/discovery/mempools/cemp.inc.php +++ b/includes/discovery/mempools/cemp.inc.php @@ -2,26 +2,29 @@ global $valid_mempool; -if($device['os'] == "ios" || $device['os_group'] == "ios") { - +if ($device['os'] == "ios" || $device['os_group'] == "ios") +{ echo("CISCO-ENHANCED-MEMORY-POOL: "); $array = snmpwalk_cache_multi_oid($device, "cempMemPoolEntry", NULL, "CISCO-ENHANCED-MEMPOOL-MIB"); - if(is_array($array)) { - foreach($array as $index => $entry) { - if(is_numeric($entry['cempMemPoolUsed']) && $entry['cempMemPoolValid'] == "true") { - list($entPhysicalIndex) = explode(".", $index); - $entPhysicalName = snmp_get($device, "entPhysicalDescr.".$entPhysicalIndex, "-Oqv", "ENTITY-MIB"); - $descr = $entPhysicalDescr." - ".$entry['cempMemPoolName']; + if (is_array($array)) + { + foreach ($array as $index => $entry) + { + if (is_numeric($entry['cempMemPoolUsed']) && $entry['cempMemPoolValid'] == "true") + { + list($entPhysicalIndex) = explode(".", $index); + $entPhysicalName = snmp_get($device, "entPhysicalDescr.".$entPhysicalIndex, "-Oqv", "ENTITY-MIB"); + $descr = $entPhysicalDescr." - ".$entry['cempMemPoolName']; - $descr = str_replace("Cisco ", "", $descr); - $descr = str_replace("Network Processing Engine", "", $descr); + $descr = str_replace("Cisco ", "", $descr); + $descr = str_replace("Network Processing Engine", "", $descr); - discover_mempool($valid_mempool, $device, $index, "cemp", $descr, "1", $entPhysicalIndex, NULL); + discover_mempool($valid_mempool, $device, $index, "cemp", $descr, "1", $entPhysicalIndex, NULL); } } } } -?> +?> \ No newline at end of file diff --git a/includes/discovery/mempools/cmp.inc.php b/includes/discovery/mempools/cmp.inc.php index bfc35b9ef0..e9eb804fd7 100755 --- a/includes/discovery/mempools/cmp.inc.php +++ b/includes/discovery/mempools/cmp.inc.php @@ -6,19 +6,19 @@ global $valid_mempool; $cemp_count = mysql_result(mysql_query("SELECT COUNT(*) FROM `mempools` WHERE `device_id` = '".$device['device_id']."' AND `mempool_type` = 'cemp'"),0); -if(($device['os'] == "ios" || $device['os_group'] == "ios") && $cemp_count == "0") { - +if (($device['os'] == "ios" || $device['os_group'] == "ios") && $cemp_count == "0") +{ echo("OLD-CISCO-MEMORY-POOL: "); $cmp_array = snmpwalk_cache_oid($device, 'ciscoMemoryPool', NULL, "CISCO-MEMORY-POOL-MIB"); - if(is_array($cmp_array)) { - foreach($cmp_array as $index => $cmp) { - if(is_numeric($cmp['ciscoMemoryPoolUsed']) && is_numeric($index)) { + if (is_array($cmp_array)) { + foreach ($cmp_array as $index => $cmp) { + if (is_numeric($cmp['ciscoMemoryPoolUsed']) && is_numeric($index)) { discover_mempool($valid_mempool, $device, $index, "cmp", $cmp['ciscoMemoryPoolName'], "1", NULL, NULL); } } } } -?> +?> \ No newline at end of file diff --git a/includes/discovery/mempools/hp-procurve.inc.php b/includes/discovery/mempools/hp-procurve.inc.php index 661262dfc6..4fe95c26db 100755 --- a/includes/discovery/mempools/hp-procurve.inc.php +++ b/includes/discovery/mempools/hp-procurve.inc.php @@ -2,38 +2,43 @@ global $valid_mempool; - #NETSWITCH-MIB::hpLocalMemSlotIndex.1 = INTEGER: 1 - #NETSWITCH-MIB::hpLocalMemSlabCnt.1 = Counter32: 3966 - #NETSWITCH-MIB::hpLocalMemFreeSegCnt.1 = Counter32: 166 - #NETSWITCH-MIB::hpLocalMemAllocSegCnt.1 = Counter32: 3803 - #NETSWITCH-MIB::hpLocalMemTotalBytes.1 = INTEGER: 11337704 - #NETSWITCH-MIB::hpLocalMemFreeBytes.1 = INTEGER: 9669100 - #NETSWITCH-MIB::hpLocalMemAllocBytes.1 = INTEGER: 1668732 +#NETSWITCH-MIB::hpLocalMemSlotIndex.1 = INTEGER: 1 +#NETSWITCH-MIB::hpLocalMemSlabCnt.1 = Counter32: 3966 +#NETSWITCH-MIB::hpLocalMemFreeSegCnt.1 = Counter32: 166 +#NETSWITCH-MIB::hpLocalMemAllocSegCnt.1 = Counter32: 3803 +#NETSWITCH-MIB::hpLocalMemTotalBytes.1 = INTEGER: 11337704 +#NETSWITCH-MIB::hpLocalMemFreeBytes.1 = INTEGER: 9669100 +#NETSWITCH-MIB::hpLocalMemAllocBytes.1 = INTEGER: 1668732 - #NETSWITCH-MIB::hpGlobalMemSlotIndex.1 = INTEGER: 1 - #NETSWITCH-MIB::hpGlobalMemSlabCnt.1 = Counter32: 3966 - #NETSWITCH-MIB::hpGlobalMemFreeSegCnt.1 = Counter32: 166 - #NETSWITCH-MIB::hpGlobalMemAllocSegCnt.1 = Counter32: 3803 - #NETSWITCH-MIB::hpGlobalMemTotalBytes.1 = INTEGER: 11337704 - #NETSWITCH-MIB::hpGlobalMemFreeBytes.1 = INTEGER: 9669104 - #NETSWITCH-MIB::hpGlobalMemAllocBytes.1 = INTEGER: 1668728 +#NETSWITCH-MIB::hpGlobalMemSlotIndex.1 = INTEGER: 1 +#NETSWITCH-MIB::hpGlobalMemSlabCnt.1 = Counter32: 3966 +#NETSWITCH-MIB::hpGlobalMemFreeSegCnt.1 = Counter32: 166 +#NETSWITCH-MIB::hpGlobalMemAllocSegCnt.1 = Counter32: 3803 +#NETSWITCH-MIB::hpGlobalMemTotalBytes.1 = INTEGER: 11337704 +#NETSWITCH-MIB::hpGlobalMemFreeBytes.1 = INTEGER: 9669104 +#NETSWITCH-MIB::hpGlobalMemAllocBytes.1 = INTEGER: 1668728 - $array = snmpwalk_cache_oid($device, "hpLocal", NULL, "NETSWITCH-MIB", $config['mibdir'].":".$config['mibdir']."/hp"); - $array = snmpwalk_cache_oid($device, "hpGlobal", $array, "NETSWITCH-MIB", $config['mibdir'].":".$config['mibdir']."/hp"); +$array = snmpwalk_cache_oid($device, "hpLocal", NULL, "NETSWITCH-MIB", $config['mibdir'].":".$config['mibdir']."/hp"); +$array = snmpwalk_cache_oid($device, "hpGlobal", $array, "NETSWITCH-MIB", $config['mibdir'].":".$config['mibdir']."/hp"); -if(is_array($array)) { - echo("procurve : "); - foreach($array as $index => $mempool) +if (is_array($array)) +{ + echo("Procurve : "); + foreach ($array as $index => $mempool) { - if(is_numeric($index) && is_numeric($mempool['hpLocalMemTotalBytes'])) { + if (is_numeric($index) && is_numeric($mempool['hpLocalMemTotalBytes'])) + { discover_mempool($valid_mempool, $device, $index, "hpLocal", "Local Memory ".$index, NULL, NULL, NULL); } - if(is_numeric($index) && is_numeric($mempool['hpGlobalMemTotalBytes'])) { + + if (is_numeric($index) && is_numeric($mempool['hpGlobalMemTotalBytes'])) + { discover_mempool($valid_mempool, $device, $index, "hpGlobal", "Global Memory ".$index, NULL, NULL, NULL); } + unset($deny, $fstype, $descr, $size, $used, $units); } unset($array); } -?> +?> \ No newline at end of file diff --git a/includes/discovery/mempools/hrstorage.inc.php b/includes/discovery/mempools/hrstorage.inc.php index 87ff3779d4..c3d18943c7 100755 --- a/includes/discovery/mempools/hrstorage.inc.php +++ b/includes/discovery/mempools/hrstorage.inc.php @@ -4,9 +4,10 @@ global $valid_mempool; $storage_array = snmpwalk_cache_oid($device, "hrStorageEntry", NULL, "HOST-RESOURCES-MIB:HOST-RESOURCES-TYPES"); -if(is_array($storage_array)) { +if (is_array($storage_array)) +{ echo("hrStorage : "); - foreach($storage_array as $index => $storage) + foreach ($storage_array as $index => $storage) { $fstype = $storage['hrStorageType']; $descr = $storage['hrStorageDescr']; @@ -18,16 +19,19 @@ if(is_array($storage_array)) { if ($fstype == "hrStorageVirtualMemory" || $fstype == "hrStorageRam") { $deny = 0; } if ($device['os'] == "routeros" && $descr == "main memory") { $deny = 0; } - if(strstr($descr, "MALLOC") || strstr($descr, "UMA")) { $deny = 1; } ## Ignore FreeBSD INSANITY - if(strstr($descr, "procfs") || strstr($descr, "/proc")) { $deny = 1; } ## Ignore ProcFS + if (strstr($descr, "MALLOC") || strstr($descr, "UMA")) { $deny = 1; } ## Ignore FreeBSD INSANITY + if (strstr($descr, "procfs") || strstr($descr, "/proc")) { $deny = 1; } ## Ignore ProcFS - if(!$deny && is_numeric($index)) { + 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); } + unset($storage_array); } -?> +?> \ No newline at end of file diff --git a/includes/discovery/mempools/ironware-dyn.inc.php b/includes/discovery/mempools/ironware-dyn.inc.php index 94150eafc9..3738480480 100755 --- a/includes/discovery/mempools/ironware-dyn.inc.php +++ b/includes/discovery/mempools/ironware-dyn.inc.php @@ -2,17 +2,15 @@ global $valid_mempool; -if($device['os'] == "ironware" || $device['os_type'] == "ironware") { - +if ($device['os'] == "ironware" || $device['os_type'] == "ironware") +{ echo("Ironware Dynamic: "); - $percent = snmp_get($device, "snAgGblDynMemUtil.0", "-OvQ", "FOUNDRY-SN-AGENT-MIB"); - if(is_numeric($percent)) { + if (is_numeric($percent)) + { discover_mempool($valid_mempool, $device, 0, "ironware-dyn", "Dynamic Memory", "1", NULL, NULL); } - - } -?> +?> \ No newline at end of file diff --git a/includes/discovery/mempools/junos.inc.php b/includes/discovery/mempools/junos.inc.php index 4991e57427..c2b6074fbf 100755 --- a/includes/discovery/mempools/junos.inc.php +++ b/includes/discovery/mempools/junos.inc.php @@ -3,22 +3,26 @@ global $valid_mempool; ## JUNOS mempools -if($device['os'] == "junos") +if ($device['os'] == "junos") { echo("JUNOS : "); $mempools_array = snmpwalk_cache_multi_oid($device, "jnxOperatingBuffer", $mempools_array, "JUNIPER-MIB" , $config['install_dir']."/mibs/junos"); $mempools_array = snmpwalk_cache_multi_oid($device, "jnxOperatingDRAMSize", $mempools_array, "JUNIPER-MIB" , $config['install_dir']."/mibs/junos"); $mempools_array = snmpwalk_cache_multi_oid($device, "jnxOperatingDescr", $mempools_array, "JUNIPER-MIB" , $config['install_dir']."/mibs/junos"); - if($debug) { print_r($mempools_array); } + if ($debug) { print_r($mempools_array); } - if(is_array($mempools_array)) { - foreach($mempools_array as $index => $entry) { - if($entry['jnxOperatingDRAMSize'] && !strpos($entry['jnxOperatingDescr'], "sensor") && !strstr($entry['jnxOperatingDescr'], "fan")) { + if (is_array($mempools_array)) + { + foreach ($mempools_array as $index => $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 != "" ) { + if (!strstr($descr, "No") && !strstr($usage, "No") && $descr != "" ) + { discover_mempool($valid_mempool, $device, $index, "junos", $descr, "1", NULL, NULL); } } ## End if checks @@ -26,6 +30,6 @@ if($device['os'] == "junos") } ## End if array } ## End JUNOS mempools - unset ($mempools_array); +unset ($mempools_array); -?> +?> \ No newline at end of file diff --git a/includes/discovery/mempools/screenos.inc.php b/includes/discovery/mempools/screenos.inc.php index 053dacdbff..5a7fc0f551 100755 --- a/includes/discovery/mempools/screenos.inc.php +++ b/includes/discovery/mempools/screenos.inc.php @@ -2,8 +2,8 @@ global $valid_mempool; -if($device['os'] == "screenos") { - +if ($device['os'] == "screenos") +{ echo("ScreenOS: "); $used = snmp_get($device, ".1.3.6.1.4.1.3224.16.2.1.0", "-OvQ"); @@ -12,10 +12,9 @@ if($device['os'] == "screenos") { $percent = $used / $total * 100; - if(is_numeric($total) && is_numeric($used)) { + if (is_numeric($total) && is_numeric($used)) + { discover_mempool($valid_mempool, $device, 0, "screenos", "Memory", "1", NULL, NULL); } - - } -?> +?> \ No newline at end of file