From a5efb98a4e0a9dc0702492b49ba05f517be8f57b Mon Sep 17 00:00:00 2001 From: Alan Gregory Date: Sat, 30 May 2015 10:06:47 -0300 Subject: [PATCH 1/3] Changed discovery to Device based, diferent Oids for soem devices --- .../discovery/processors/powerconnect.inc.php | 40 ++++++++++--------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/includes/discovery/processors/powerconnect.inc.php b/includes/discovery/processors/powerconnect.inc.php index 126d9cccb..f385bdd4e 100644 --- a/includes/discovery/processors/powerconnect.inc.php +++ b/includes/discovery/processors/powerconnect.inc.php @@ -1,23 +1,27 @@ From 343dbcc134d0eae583050fbc74617701c6c35999 Mon Sep 17 00:00:00 2001 From: Alan Gregory Date: Sat, 30 May 2015 10:07:34 -0300 Subject: [PATCH 2/3] Default OID types should use default processor pooling --- .../polling/processors/powerconnect.inc.php | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/includes/polling/processors/powerconnect.inc.php b/includes/polling/processors/powerconnect.inc.php index 7011acd2b..bb6d03198 100644 --- a/includes/polling/processors/powerconnect.inc.php +++ b/includes/polling/processors/powerconnect.inc.php @@ -1,11 +1,15 @@ +$sysObjectId = snmp_get ($device, "SNMPv2-MIB::sysObjectID.0", "-Ovqn"); +switch ($sysObjectId) { + case ".1.3.6.1.4.1.674.10895.3031": + /** + * Devices supported: + * Dell Powerconnect 55xx + */ + $proc = snmp_get ($device, $processor['processor_oid'], "-O Uqnv", "\"\""); + break; + default : + $values = trim(snmp_get($device, "dellLanExtension.6132.1.1.1.1.4.4.0", "-OvQ", "Dell-Vendor-MIB"),'"'); + preg_match('/5 Sec \((.*)%\),.*1 Min \((.*)%\),.*5 Min \((.*)%\)$/', $values, $matches); + $proc = $matches[3]; +} From 3ee9d4f0f7bba35a6c89922b66ebb76ed4dac944 Mon Sep 17 00:00:00 2001 From: Alan Gregory Date: Sat, 30 May 2015 10:24:30 -0300 Subject: [PATCH 3/3] Changed temperature discovery per device model --- .../temperatures/powerconnect.inc.php | 49 ++++++++++++------- 1 file changed, 32 insertions(+), 17 deletions(-) diff --git a/includes/discovery/temperatures/powerconnect.inc.php b/includes/discovery/temperatures/powerconnect.inc.php index 18df1f5e7..1a48dcd37 100644 --- a/includes/discovery/temperatures/powerconnect.inc.php +++ b/includes/discovery/temperatures/powerconnect.inc.php @@ -2,23 +2,38 @@ if ($device['os'] == "powerconnect") { - $temps = snmp_walk($device, "boxServicesTempSensorTemperature", "-OsqnU", "FASTPATH-BOXSERVICES-PRIVATE-MIB"); - if ($debug) { echo($temps."\n"); } + $sysObjectId = snmp_get ($device, "SNMPv2-MIB::sysObjectID.0", "-Ovqn"); + switch ($sysObjectId) { + case ".1.3.6.1.4.1.674.10895.3031": + /** + * Devices supported: + * Dell Powerconnect 55xx + * Operating Temperature: 0º C to 40º C + */ + $temperature = trim(snmp_get($device, ".1.3.6.1.4.1.89.53.15.1.9.1", "-Ovq")); + discover_sensor($valid['sensor'], 'temperature', $device , ".1.3.6.1.4.1.89.53.15.1.9.1", 0 , "powerconnect" , "Internal Temperature" , '1', '1', "0" , NULL, NULL, "40", $temperature); + break; + default : + /** + * Defaul Discovery for powerconnect series + * Dell-Vendor-MIB::dellLanExtension.6132.1.1.1.1.4.4.0 = STRING: "5 Sec (6.99%), 1 Min (6.72%), 5 Min (9.06%)" + */ + $temps = snmp_walk($device, "boxServicesTempSensorTemperature", "-OsqnU", "FASTPATH-BOXSERVICES-PRIVATE-MIB"); + if ($debug) { echo($temps."\n"); } - $index = 0; - foreach (explode("\n",$temps) as $oids) - { - echo("Powerconnect "); - list($oid,$current) = explode(' ',$oids); - $divisor = "1"; - $multiplier = "1"; - $type = "powerconnect"; - $index++; - $descr = "Internal Temperature"; - if (count(explode("\n",$temps)) > 1) { $descr .= " $index"; } + $index = 0; + foreach (explode("\n",$temps) as $oids) + { + echo("Powerconnect "); + list($oid,$current) = explode(' ',$oids); + $divisor = "1"; + $multiplier = "1"; + $type = "powerconnect"; + $index++; + $descr = "Internal Temperature"; + if (count(explode("\n",$temps)) > 1) { $descr .= " $index"; } - discover_sensor($valid['sensor'], 'temperature', $device, $oid, $index, $type, $descr, $divisor, $multiplier, NULL, NULL, NULL, NULL, $current); - } + discover_sensor($valid['sensor'], 'temperature', $device, $oid, $index, $type, $descr, $divisor, $multiplier, NULL, NULL, NULL, NULL, $current); + } + } } - -?>