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:
Tom Laermans
2012-02-15 17:14:58 +00:00
parent 752bbc2af8
commit db6c9cb9d2
4 changed files with 35 additions and 1 deletions

View File

@@ -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);
?>

View File

@@ -4,7 +4,7 @@ foreach (dbFetchRows("SELECT * FROM processors WHERE device_id = ?", array($devi
{ {
echo("Processor " . $processor['processor_descr'] . "... "); 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)) if (is_file($file))
{ {
include($file); include($file);

View 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];
?>