add OS detection and temperature support for Comet System P85xx, os detection for blade network technologies hardware

git-svn-id: http://www.observium.org/svn/observer/trunk@1943 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2011-03-21 11:03:24 +00:00
parent 4a323d81b3
commit 86a3f67f4d
12 changed files with 1170 additions and 9 deletions
+8
View File
@@ -0,0 +1,8 @@
<?php
if (!$os)
{
if (stristr($sysDescr, "Blade Network Technologies")) { $os = "bnt"; }
}
?>
+14
View File
@@ -0,0 +1,14 @@
<?php
if (!$os)
{
if (preg_match('/.+Firmware Version \d+-\d+-\d+.+/', $sysDescr))
{
if (is_numeric(snmp_get($device, ".1.3.6.1.4.1.22626.1.5.2.1.3.0", "-Oqv", "")))
{
$os = "cometsystem-p85xx";
}
}
}
?>
+8
View File
@@ -0,0 +1,8 @@
<?php
if (!$os)
{
if (preg_match("/^NWA-/", $sysDescr)) { $os = "zyxelnwa"; }
}
?>
@@ -0,0 +1,65 @@
<?php
global $valid_sensor;
if ($device['os'] == "cometsystem-p85xx")
{
$regexp = '/
\.1\.3\.6\.1\.4\.1\.22626\.1\.5\.2\.
(?P<id>\d+)
\.
(?:
1\.0 (?P<name>.*)|
3\.0 (?P<temp_intval>.*)|
5\.0 (?P<limit_high>.*)|
6\.0 (?P<limit_low>.*)|
)
/x';
$oids = snmp_walk($device, ".1.3.6.1.4.1.22626.1.5.2", "-OsqnU", "");
#if ($debug) { echo($oids."\n"); }
if ($oids)
{
$out = array();
foreach(explode("\n", $oids) as $line)
{
preg_match($regexp, $line, $match);
if ($match['name'])
{
$out[$match['id']]['name'] = $match['name'];
}
if ($match['temp_intval'])
{
$out[$match['id']]['temp_intval'] = $match['temp_intval'];
}
if ($match['limit_high'])
{
$out[$match['id']]['limit_high'] = $match['limit_high'];
}
if ($match['limit_low'])
{
$out[$match['id']]['limit_low'] = $match['limit_low'];
}
}
foreach($out as $sensor_id=>$sensor)
{
if ($sensor['temp_intval'] != 9999)
{
$temperature_oid = '.1.3.6.1.4.1.22626.1.5.2.' . $sensor_id . '.3.0';
$temperature_id = $sensor_id;
$descr = trim($sensor['name'], ' "');
$lowlimit = trim($sensor['limit_low'], ' "');
$limit = trim($sensor['limit_high'], ' "');
$temperature = $sensor['temp_intval'];
discover_sensor($valid_sensor, 'temperature', $device, $temperature_oid, $temperature_id, 'cometsystem-p85xx', $descr, '10', '1', $lowlimit, NULL, NULL, $limit, $temperature);
}
}
}
}
?>
+10
View File
@@ -0,0 +1,10 @@
<?php
preg_match('/Blade Network Technologies (.*)$/', $sysDescr, $store);
if (isset($store[1]))
{
$hardware = $store[1];
}
?>
+5
View File
@@ -0,0 +1,5 @@
<?php
$hardware = $sysDescr;
?>
+18 -9
View File
@@ -88,12 +88,6 @@ $config['os'][$os]['type'] = "network";
$config['os'][$os]['ifXmcbc'] = 1;
$config['os'][$os]['over'][0]['graph'] = "device_bits";
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
#$config['os'][$os]['over'][1]['graph'] = "device_processors";
#$config['os'][$os]['over'][1]['text'] = "CPU Usage";
#$config['os'][$os]['over'][2]['graph'] = "device_mempools";
#$config['os'][$os]['over'][2]['text'] = "Memory Usage";
#$config['os'][$os]['icon'] = "cisco";
$os = "ios";
$config['os'][$os]['group'] = "ios";
@@ -248,7 +242,6 @@ $config['os'][$os]['over'][0]['text'] = "Device Traffic";
#$config['os'][$os]['over'][2]['graph'] = "device_mempools";
#$config['os'][$os]['over'][2]['text'] = "Memory Usage";
$os = "routeros";
$config['os'][$os]['text'] = "Mikrotik RouterOS";
$config['os'][$os]['type'] = "network";
@@ -332,7 +325,6 @@ $config['os'][$os]['over'][1]['text'] = "CPU Usage";
$config['os'][$os]['over'][2]['graph'] = "device_mempools";
$config['os'][$os]['over'][2]['text'] = "Memory Usage";
$os = "powerconnect";
$config['os'][$os]['text'] = "Dell PowerConnect";
$config['os'][$os]['ifname'] = 1;
@@ -425,6 +417,11 @@ $os = "windows";
$config['os'][$os]['text'] = "Microsoft Windows";
$config['os'][$os]['ifname'] = 1;
$os = "bnt";
$config['os'][$os]['text'] = "Blade Network Technologies";
$config['os'][$os]['type'] = "network";
$config['os'][$os]['icon'] = "bnt";
$os = "procurve";
$config['os'][$os]['text'] = "HP ProCurve";
$config['os'][$os]['type'] = "network";
@@ -466,6 +463,11 @@ $config['os'][$os]['text'] = "ZyXEL Ethernet Switch";
$config['os'][$os]['type'] = "network";
$config['os'][$os]['icon'] = "zyxel";
$os = "zyxelnwa";
$config['os'][$os]['text'] = "ZyXEL NWA";
$config['os'][$os]['type'] = "network";
$config['os'][$os]['icon'] = "zyxel";
$os = "ies";
$config['os'][$os]['text'] = "ZyXEL DSLAM";
$config['os'][$os]['type'] = "network";
@@ -547,6 +549,13 @@ $config['os'][$os]['type'] = "environment";
$config['os'][$os]['over'][0]['graph'] = "device_temperatures";
$config['os'][$os]['over'][0]['text'] = "Temperatures";
$os = "cometsystem-p85xx";
$config['os'][$os]['text'] = "Comet System P85xx";
$config['os'][$os]['type'] = "environment";
$config['os'][$os]['icon'] = "comet";
$config['os'][$os]['over'][0]['graph'] = "device_temperatures";
$config['os'][$os]['over'][0]['text'] = "Temperatures";
$os = "dell-laser";
$config['os'][$os]['group'] = "printer";
$config['os'][$os]['text'] = "Dell Laser";
@@ -862,4 +871,4 @@ $ipmi_unit['RPM'] = 'fanspeed';
$ipmi_unit['Watts'] = '';
$ipmi_unit['discrete'] = '';
?>
?>