mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-25 00:32:16 +02:00
Merge pull request #1165 from alangregory/powerconnect
Added Powerconnect 55xx Discovery/Polling
This commit is contained in:
@@ -1,23 +1,27 @@
|
||||
<?php
|
||||
|
||||
///
|
||||
// Hardcoded discovery of cpu usage on Dell Powerconnect devices.
|
||||
///
|
||||
// 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%)"
|
||||
|
||||
if ($device['os'] == "powerconnect")
|
||||
{
|
||||
echo("Powerconnect : ");
|
||||
$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
|
||||
*/
|
||||
$usage = trim(snmp_get($device, ".1.3.6.1.4.1.89.1.7.0", "-Ovq"));
|
||||
discover_processor($valid['processor'], $device, ".1.3.6.1.4.1.89.1.7.0", "0", "powerconnect","Processor", "1", $usage, NULL, NULL);
|
||||
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%)"
|
||||
*/
|
||||
$descr = "Processor";
|
||||
$usage = trim(snmp_get($device, "dellLanExtension.6132.1.1.1.1.4.4.0", "-OQUvs", "Dell-Vendor-MIB"),'"');
|
||||
if (substr($usage,0,5) == "5 Sec")
|
||||
{
|
||||
discover_processor($valid['processor'], $device, ".1.3.6.1.4.1.674.10895.5000.2.6132.1.1.1.1.4.4.0", "0", "powerconnect", $descr, "1", $usage, NULL, NULL);
|
||||
}
|
||||
|
||||
$descr = "Processor";
|
||||
$usage = trim(snmp_get($device, "dellLanExtension.6132.1.1.1.1.4.4.0", "-OQUvs", "Dell-Vendor-MIB"),'"');
|
||||
|
||||
if (substr($usage,0,5) == "5 Sec")
|
||||
{
|
||||
discover_processor($valid['processor'], $device, ".1.3.6.1.4.1.674.10895.5000.2.6132.1.1.1.1.4.4.0", "0", "powerconnect", $descr, "1", $usage, NULL, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unset ($processors_array);
|
||||
|
||||
?>
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
<?php
|
||||
|
||||
# "5 Sec (7.31%), 1 Min (14.46%), 5 Min (10.90%)"
|
||||
|
||||
$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];
|
||||
|
||||
?>
|
||||
$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];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user