mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-27 00:25:06 +02:00
add poller/discovery for dell powerconnect cpu
git-svn-id: http://www.observium.org/svn/observer/trunk@2864 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
+23
@@ -0,0 +1,23 @@
|
||||
<?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 : ");
|
||||
|
||||
$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);
|
||||
|
||||
?>
|
||||
@@ -4,7 +4,7 @@ foreach (dbFetchRows("SELECT * FROM processors WHERE device_id = ?", array($devi
|
||||
{
|
||||
echo("Processor " . $processor['processor_descr'] . "... ");
|
||||
|
||||
$file = $config['install_dir']."/includes/polling/processors-".$processor['processor_type'].".inc.php";
|
||||
$file = $config['install_dir']."/includes/polling/processors/".$processor['processor_type'].".inc.php";
|
||||
if (is_file($file))
|
||||
{
|
||||
include($file);
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
<?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];
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user