reformat mempool and current discovery

git-svn-id: http://www.observium.org/svn/observer/trunk@1834 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2011-03-14 19:24:23 +00:00
parent c00959e44b
commit 0a2371cfc7
13 changed files with 129 additions and 104 deletions
+15 -15
View File
@@ -12,7 +12,7 @@ if ($device['os'] == "apc")
if ($oids) echo("APC "); if ($oids) echo("APC ");
$type = "apc"; $type = "apc";
$precision = "10"; $precision = "10";
foreach(explode("\n", $oids) as $data) foreach (explode("\n", $oids) as $data)
{ {
$data = trim($data); $data = trim($data);
if ($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", ""); $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) if ($atsCurrent)
{ {
$current_oid = "1.3.6.1.4.1.318.1.1.8.5.4.3.1.4.1.1.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"; $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"; $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"; $warnlimit_oid = "1.3.6.1.4.1.318.1.1.8.4.16.1.4.1";
$index = 1; $index = 1;
$current = snmp_get($device, $current_oid, "-Oqv", "") / $precision; $current = snmp_get($device, $current_oid, "-Oqv", "") / $precision;
$limit = snmp_get($device, $limit_oid, "-Oqv", ""); # No / $precision here! Nice, APC! $limit = snmp_get($device, $limit_oid, "-Oqv", ""); # No / $precision here! Nice, APC!
$lowlimit = snmp_get($device, $lowlimit_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! $warnlimit = snmp_get($device, $warnlimit_oid, "-Oqv", ""); # No / $precision here! Nice, APC!
$descr = "Output Feed"; $descr = "Output Feed";
echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, NULL, $warnlimit, $limit, $current));
echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, NULL, $warnlimit, $limit, $current));
} }
} }
?>
?>
@@ -2,9 +2,9 @@
global $valid_sensor; 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"; $current_oid = "GAMATRONIC-MIB::gamatronicLTD.5.4.1.1.3.$i";
$descr = "Input Phase $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)); 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"; $current_oid = "GAMATRONIC-MIB::gamatronicLTD.5.5.1.1.3.$i";
$descr = "Output Phase $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)); echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '1', '1', $lowlimit, NULL, NULL, NULL, $current));
} }
} }
?>
?>
+7 -6
View File
@@ -7,8 +7,8 @@ if ($device['os'] == "ipoman")
{ {
echo(" IPOMANII-MIB "); echo(" IPOMANII-MIB ");
if(!is_array($cache['ipoman'])) if (!is_array($cache['ipoman']))
{ {
echo("outletConfigDesc "); echo("outletConfigDesc ");
$cache['ipoman']['out'] = snmpwalk_cache_multi_oid($device, "outletConfigDesc", $cache['ipoman']['out'], "IPOMANII-MIB"); $cache['ipoman']['out'] = snmpwalk_cache_multi_oid($device, "outletConfigDesc", $cache['ipoman']['out'], "IPOMANII-MIB");
echo("outletConfigLocation "); 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, "outletStatusCurrent", $oids_out, "IPOMANII-MIB");
// $oids_out = snmpwalk_cache_multi_oid($device, "outletStatusKwatt", $oids_out, "IPOMANII-MIB"); // See above // $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; $cur_oid = '.1.3.6.1.4.1.2468.1.4.2.1.3.1.3.1.3.' . $index;
$divisor = 1000; $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; $cur_oid = '.1.3.6.1.4.1.2468.1.4.2.1.3.2.3.1.3.' . $index;
$divisor = 1000; $divisor = 1000;
@@ -58,4 +58,5 @@ if ($device['os'] == "ipoman")
} }
} }
} }
?> ?>
+6 -3
View File
@@ -3,7 +3,7 @@
global $valid_sensor; global $valid_sensor;
## MGE UPS ## MGE UPS
if ($device['os'] == "mgeups") if ($device['os'] == "mgeups")
{ {
echo("MGE "); echo("MGE ");
$oids = trim(snmp_walk($device, "1.3.6.1.4.1.705.1.7.1", "-OsqnU")); $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; $lowlimit = 0;
$limit = NULL; $limit = NULL;
$lowwarnlimit = 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")); $oids = trim(snmp_walk($device, "1.3.6.1.4.1.705.1.6.1", "-OsqnU"));
if ($debug) { echo($oids."\n"); } if ($debug) { echo($oids."\n"); }
$numPhase = count(explode("\n",$oids)); $numPhase = count(explode("\n",$oids));
@@ -53,7 +54,9 @@ if ($device['os'] == "mgeups")
$lowlimit = 0; $lowlimit = 0;
$limit = NULL; $limit = NULL;
$lowwarnlimit = 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));
} }
} }
?>
?>
+9 -5
View File
@@ -3,17 +3,17 @@
global $valid_sensor; global $valid_sensor;
## RFC1628 UPS ## RFC1628 UPS
if ($device['os'] == "netmanplus" || $device['os'] == "deltaups") if ($device['os'] == "netmanplus" || $device['os'] == "deltaups")
{ {
echo("RFC1628 "); echo("RFC1628 ");
$oids = snmp_walk($device, "1.3.6.1.2.1.33.1.2.6", "-Osqn", "UPS-MIB"); $oids = snmp_walk($device, "1.3.6.1.2.1.33.1.2.6", "-Osqn", "UPS-MIB");
if ($debug) { echo($oids."\n"); } if ($debug) { echo($oids."\n"); }
$oids = trim($oids); $oids = trim($oids);
foreach(explode("\n", $oids) as $data) foreach (explode("\n", $oids) as $data)
{ {
$data = trim($data); $data = trim($data);
if ($data) if ($data)
{ {
list($oid,$descr) = explode(" ", $data,2); list($oid,$descr) = explode(" ", $data,2);
$split_oid = explode('.',$oid); $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)); $descr = "Battery" . (count(explode("\n",$oids)) == 1 ? '' : ' ' . ($current_id+1));
$type = "rfc1628"; $type = "rfc1628";
$index = 500+$current_id; $index = 500+$current_id;
echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '10', '1', NULL, NULL, NULL, NULL, $current)); 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"; $type = "rfc1628";
$precision = 1; $precision = 1;
$index = $i; $index = $i;
echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '1', '1', NULL, NULL, NULL, NULL, $current)); 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"; $type = "rfc1628";
$precision = 1; $precision = 1;
$index = 100+$i; $index = 100+$i;
echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '1', '1', NULL, NULL, NULL, NULL, $current)); 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"; $type = "rfc1628";
$precision = 1; $precision = 1;
$index = 200+$i; $index = 200+$i;
echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '1', '1', NULL, NULL, NULL, NULL, $current)); echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '1', '1', NULL, NULL, NULL, NULL, $current));
} }
} }
?> ?>
+7 -4
View File
@@ -6,14 +6,14 @@ global $valid_sensor;
if ($device['os'] == "powerware") if ($device['os'] == "powerware")
{ {
echo("XUPS-MIB "); echo("XUPS-MIB ");
$oids = snmp_walk($device, "xupsBatCurrent", "-Osqn", "XUPS-MIB"); $oids = snmp_walk($device, "xupsBatCurrent", "-Osqn", "XUPS-MIB");
if ($debug) { echo($oids."\n"); } if ($debug) { echo($oids."\n"); }
$oids = trim($oids); $oids = trim($oids);
foreach(explode("\n", $oids) as $data) foreach (explode("\n", $oids) as $data)
{ {
$data = trim($data); $data = trim($data);
if ($data) if ($data)
{ {
list($oid,$descr) = explode(" ", $data,2); list($oid,$descr) = explode(" ", $data,2);
$split_oid = explode('.',$oid); $split_oid = explode('.',$oid);
@@ -24,6 +24,7 @@ if ($device['os'] == "powerware")
$descr = "Battery" . (count(explode("\n",$oids)) == 1 ? '' : ' ' . ($current_id+1)); $descr = "Battery" . (count(explode("\n",$oids)) == 1 ? '' : ' ' . ($current_id+1));
$type = "xups"; $type = "xups";
$index = "1.2.3.".$current_id; $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)); 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"; $type = "xups";
$divisor = 1; $divisor = 1;
$index = "4.4.1.3.".$i; $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)); 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"; $type = "xups";
$divisor = 1; $divisor = 1;
$index = "3.4.1.3.".$i; $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)); echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current));
} }
} }
?> ?>
+15 -12
View File
@@ -2,26 +2,29 @@
global $valid_mempool; global $valid_mempool;
if($device['os'] == "ios" || $device['os_group'] == "ios") { if ($device['os'] == "ios" || $device['os_group'] == "ios")
{
echo("CISCO-ENHANCED-MEMORY-POOL: "); echo("CISCO-ENHANCED-MEMORY-POOL: ");
$array = snmpwalk_cache_multi_oid($device, "cempMemPoolEntry", NULL, "CISCO-ENHANCED-MEMPOOL-MIB"); $array = snmpwalk_cache_multi_oid($device, "cempMemPoolEntry", NULL, "CISCO-ENHANCED-MEMPOOL-MIB");
if(is_array($array)) { if (is_array($array))
foreach($array as $index => $entry) { {
if(is_numeric($entry['cempMemPoolUsed']) && $entry['cempMemPoolValid'] == "true") { foreach ($array as $index => $entry)
list($entPhysicalIndex) = explode(".", $index); {
$entPhysicalName = snmp_get($device, "entPhysicalDescr.".$entPhysicalIndex, "-Oqv", "ENTITY-MIB"); if (is_numeric($entry['cempMemPoolUsed']) && $entry['cempMemPoolValid'] == "true")
$descr = $entPhysicalDescr." - ".$entry['cempMemPoolName']; {
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("Cisco ", "", $descr);
$descr = str_replace("Network Processing Engine", "", $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);
} }
} }
} }
} }
?> ?>
+6 -6
View File
@@ -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); $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: "); echo("OLD-CISCO-MEMORY-POOL: ");
$cmp_array = snmpwalk_cache_oid($device, 'ciscoMemoryPool', NULL, "CISCO-MEMORY-POOL-MIB"); $cmp_array = snmpwalk_cache_oid($device, 'ciscoMemoryPool', NULL, "CISCO-MEMORY-POOL-MIB");
if(is_array($cmp_array)) { if (is_array($cmp_array)) {
foreach($cmp_array as $index => $cmp) { foreach ($cmp_array as $index => $cmp) {
if(is_numeric($cmp['ciscoMemoryPoolUsed']) && is_numeric($index)) { if (is_numeric($cmp['ciscoMemoryPoolUsed']) && is_numeric($index)) {
discover_mempool($valid_mempool, $device, $index, "cmp", $cmp['ciscoMemoryPoolName'], "1", NULL, NULL); discover_mempool($valid_mempool, $device, $index, "cmp", $cmp['ciscoMemoryPoolName'], "1", NULL, NULL);
} }
} }
} }
} }
?> ?>
+27 -22
View File
@@ -2,38 +2,43 @@
global $valid_mempool; global $valid_mempool;
#NETSWITCH-MIB::hpLocalMemSlotIndex.1 = INTEGER: 1 #NETSWITCH-MIB::hpLocalMemSlotIndex.1 = INTEGER: 1
#NETSWITCH-MIB::hpLocalMemSlabCnt.1 = Counter32: 3966 #NETSWITCH-MIB::hpLocalMemSlabCnt.1 = Counter32: 3966
#NETSWITCH-MIB::hpLocalMemFreeSegCnt.1 = Counter32: 166 #NETSWITCH-MIB::hpLocalMemFreeSegCnt.1 = Counter32: 166
#NETSWITCH-MIB::hpLocalMemAllocSegCnt.1 = Counter32: 3803 #NETSWITCH-MIB::hpLocalMemAllocSegCnt.1 = Counter32: 3803
#NETSWITCH-MIB::hpLocalMemTotalBytes.1 = INTEGER: 11337704 #NETSWITCH-MIB::hpLocalMemTotalBytes.1 = INTEGER: 11337704
#NETSWITCH-MIB::hpLocalMemFreeBytes.1 = INTEGER: 9669100 #NETSWITCH-MIB::hpLocalMemFreeBytes.1 = INTEGER: 9669100
#NETSWITCH-MIB::hpLocalMemAllocBytes.1 = INTEGER: 1668732 #NETSWITCH-MIB::hpLocalMemAllocBytes.1 = INTEGER: 1668732
#NETSWITCH-MIB::hpGlobalMemSlotIndex.1 = INTEGER: 1 #NETSWITCH-MIB::hpGlobalMemSlotIndex.1 = INTEGER: 1
#NETSWITCH-MIB::hpGlobalMemSlabCnt.1 = Counter32: 3966 #NETSWITCH-MIB::hpGlobalMemSlabCnt.1 = Counter32: 3966
#NETSWITCH-MIB::hpGlobalMemFreeSegCnt.1 = Counter32: 166 #NETSWITCH-MIB::hpGlobalMemFreeSegCnt.1 = Counter32: 166
#NETSWITCH-MIB::hpGlobalMemAllocSegCnt.1 = Counter32: 3803 #NETSWITCH-MIB::hpGlobalMemAllocSegCnt.1 = Counter32: 3803
#NETSWITCH-MIB::hpGlobalMemTotalBytes.1 = INTEGER: 11337704 #NETSWITCH-MIB::hpGlobalMemTotalBytes.1 = INTEGER: 11337704
#NETSWITCH-MIB::hpGlobalMemFreeBytes.1 = INTEGER: 9669104 #NETSWITCH-MIB::hpGlobalMemFreeBytes.1 = INTEGER: 9669104
#NETSWITCH-MIB::hpGlobalMemAllocBytes.1 = INTEGER: 1668728 #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, "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, "hpGlobal", $array, "NETSWITCH-MIB", $config['mibdir'].":".$config['mibdir']."/hp");
if(is_array($array)) { if (is_array($array))
echo("procurve : "); {
foreach($array as $index => $mempool) 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); 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); discover_mempool($valid_mempool, $device, $index, "hpGlobal", "Global Memory ".$index, NULL, NULL, NULL);
} }
unset($deny, $fstype, $descr, $size, $used, $units); unset($deny, $fstype, $descr, $size, $used, $units);
} }
unset($array); unset($array);
} }
?> ?>
+10 -6
View File
@@ -4,9 +4,10 @@ global $valid_mempool;
$storage_array = snmpwalk_cache_oid($device, "hrStorageEntry", NULL, "HOST-RESOURCES-MIB:HOST-RESOURCES-TYPES"); $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 : "); echo("hrStorage : ");
foreach($storage_array as $index => $storage) foreach ($storage_array as $index => $storage)
{ {
$fstype = $storage['hrStorageType']; $fstype = $storage['hrStorageType'];
$descr = $storage['hrStorageDescr']; $descr = $storage['hrStorageDescr'];
@@ -18,16 +19,19 @@ if(is_array($storage_array)) {
if ($fstype == "hrStorageVirtualMemory" || $fstype == "hrStorageRam") { $deny = 0; } if ($fstype == "hrStorageVirtualMemory" || $fstype == "hrStorageRam") { $deny = 0; }
if ($device['os'] == "routeros" && $descr == "main memory") { $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, "MALLOC") || strstr($descr, "UMA")) { $deny = 1; } ## Ignore FreeBSD INSANITY
if(strstr($descr, "procfs") || strstr($descr, "/proc")) { $deny = 1; } ## Ignore ProcFS 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); discover_mempool($valid_mempool, $device, $index, "hrstorage", $descr, $units, NULL, NULL);
} }
unset($deny, $fstype, $descr, $size, $used, $units, $storage_rrd, $old_storage_rrd); unset($deny, $fstype, $descr, $size, $used, $units, $storage_rrd, $old_storage_rrd);
} }
unset($storage_array); unset($storage_array);
} }
?> ?>
@@ -2,17 +2,15 @@
global $valid_mempool; global $valid_mempool;
if($device['os'] == "ironware" || $device['os_type'] == "ironware") { if ($device['os'] == "ironware" || $device['os_type'] == "ironware")
{
echo("Ironware Dynamic: "); echo("Ironware Dynamic: ");
$percent = snmp_get($device, "snAgGblDynMemUtil.0", "-OvQ", "FOUNDRY-SN-AGENT-MIB"); $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); discover_mempool($valid_mempool, $device, 0, "ironware-dyn", "Dynamic Memory", "1", NULL, NULL);
} }
} }
?> ?>
+12 -8
View File
@@ -3,22 +3,26 @@
global $valid_mempool; global $valid_mempool;
## JUNOS mempools ## JUNOS mempools
if($device['os'] == "junos") if ($device['os'] == "junos")
{ {
echo("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, "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, "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"); $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)) { if (is_array($mempools_array))
foreach($mempools_array as $index => $entry) { {
if($entry['jnxOperatingDRAMSize'] && !strpos($entry['jnxOperatingDescr'], "sensor") && !strstr($entry['jnxOperatingDescr'], "fan")) { 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"); } 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; $usage_oid = ".1.3.6.1.4.1.2636.3.1.13.1.8." . $index;
$descr = $entry['jnxOperatingDescr']; $descr = $entry['jnxOperatingDescr'];
$usage = $entry['jnxOperatingBuffer']; $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); discover_mempool($valid_mempool, $device, $index, "junos", $descr, "1", NULL, NULL);
} }
} ## End if checks } ## End if checks
@@ -26,6 +30,6 @@ if($device['os'] == "junos")
} ## End if array } ## End if array
} ## End JUNOS mempools } ## End JUNOS mempools
unset ($mempools_array); unset ($mempools_array);
?> ?>
+5 -6
View File
@@ -2,8 +2,8 @@
global $valid_mempool; global $valid_mempool;
if($device['os'] == "screenos") { if ($device['os'] == "screenos")
{
echo("ScreenOS: "); echo("ScreenOS: ");
$used = snmp_get($device, ".1.3.6.1.4.1.3224.16.2.1.0", "-OvQ"); $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; $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); discover_mempool($valid_mempool, $device, 0, "screenos", "Memory", "1", NULL, NULL);
} }
} }
?> ?>