initial netbotz environmental monitor support by mrobbert

git-svn-id: http://www.observium.org/svn/observer/trunk@2437 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2011-09-08 16:26:41 +00:00
parent ba494809a9
commit 37f5ba97ce
5 changed files with 8872 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
<?php
if ($device['os'] == 'netbotz')
{
$oids = snmp_walk($device, ".1.3.6.1.4.1.5528.100.4.1.2.1.4", "-Osqn", "");
if ($debug) { echo($oids."\n"); }
$oids = trim($oids);
if ($oids)
{
echo("Netbotz ");
foreach (explode("\n", $oids) as $data)
{
list($oid,$descr) = explode(" ", $data,2);
$split_oid = explode('.',$oid);
$humidity_id = $split_oid[count($split_oid)-1];
#tempHumidSensorHumidValue
$humidity_oid = ".1.3.6.1.4.1.5528.100.4.1.2.1.8.".$humidity_id;
$humidity = snmp_get($device,"$humidity_oid", "-Ovq", "");
$descr = str_replace("\"", "", $descr);
$descr = trim($descr);
if ($humidity >= 0) {
discover_sensor($valid['sensor'], 'humidity', $device, $humidity_oid, $humidity_id, 'netbotz', $descr, '1', '1', NULL, NULL, NULL, NULL, $humidity);
}
}
unset($data);
}
unset($oids);
}
?>

View File

@@ -13,6 +13,7 @@ if (!$os)
$entPhysicalMfgName = snmp_get($device, "ENTITY-MIB::entPhysicalMfgName.1", "-Osqnv");
if(strpos($entPhysicalMfgName, "QNAP") !== FALSE) { $os = "qnap";}
elseif(strstr($sysObjectId, ".1.3.6.1.4.1.5528.100.20.10.2014")) { $os = "netbotz"; }
}

View File

@@ -0,0 +1,29 @@
<?php
if ($device['os'] == "netbotz")
{
$oids = snmp_walk($device, ".1.3.6.1.4.1.5528.100.4.1.1.1.4", "-Osqn", "");
if ($debug) { echo($oids."\n"); }
$oids = trim($oids);
if ($oids)
{
echo("NetBotz ");
foreach (explode("\n", $oids) as $data)
{
list($oid,$descr) = explode(" ", $data,2);
$split_oid = explode('.', $oid);
$temperature_id = $split_oid[count($split_oid)-1];
$temperature_oid = ".1.3.6.1.4.1.5528.100.4.1.1.1.8.$temperature_id";
$temperature = snmp_get($device, $temperature_oid, "-Ovq");
$descr = str_replace("\"", "", $descr);
$descr = preg_replace('/Temperature /', "", $descr);
$descr = trim($descr);
if ($temperature != "0" && $temperature <= "1000")
{
discover_sensor($valid['sensor'], 'temperature', $device, $temperature_oid, $temperature_id, 'netbotz', $descr, '1', '1', NULL, NULL, NULL, NULL, $temperature);
}
}
}
}
?>