Support for Sentry3 temperature and humidity, patch by falz

git-svn-id: http://www.observium.org/svn/observer/trunk@1895 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2011-03-16 22:56:58 +00:00
parent 5749d3cdae
commit b3dc4c3129
4 changed files with 97 additions and 0 deletions
@@ -0,0 +1,38 @@
<?php
global $valid_sensor;
if ($device['os'] == 'sentry3')
{
$oids = snmp_walk($device, "tempHumidSensorHumidValue", "-Osqn", "Sentry3-MIB");
$divisor = "1";
$multiplier = "1";
if ($debug) { echo($oids."\n"); }
$oids = trim($oids);
if ($oids) echo("ServerTech Sentry ");
foreach (explode("\n", $oids) as $data)
{
$data = trim($data);
if ($data)
{
list($oid,$descr) = explode(" ", $data,2);
$split_oid = explode('.',$oid);
$index = $split_oid[count($split_oid)-1];
#tempHumidSensorHumidValue
$humidity_oid = "1.3.6.1.4.1.1718.3.2.5.1.10.1.".$index;
$descr = "Removable Sensor " . $index;
$low_warn_limit = "0";
$low_limit = snmp_get($device,"tempHumidSensorHumidLowThresh.1.$index", "-Ovq", "Sentry3-MIB");
$high_warn_limit = "0";
$high_limit = snmp_get($device,"tempHumidSensorHumidHighThresh.1.$index", "-Ovq", "Sentry3-MIB");
$current = snmp_get($device,"$humidity_oid", "-Ovq", "Sentry3-MIB");
discover_sensor($valid_sensor, 'humidity', $device, $humidity_oid, $index, 'sentry3', $descr, $divisor, $multiplier, $low_limit, $low_warn_limit, $high_warn_limit, $high_limit, $current);
}
unset($data);
}
unset($oids);
}
?>
+8
View File
@@ -6,3 +6,11 @@ if (!$os)
} }
?> ?>
<?php
if (!$os)
{
if (preg_match("/^Sentry\ Switched /", $sysDescr)) { $os = "sentry3"; }
}
?>
@@ -0,0 +1,38 @@
<?php
global $valid_sensor;
if ($device['os'] == "sentry3")
{
$oids = snmp_walk($device, "tempHumidSensorTempValue", "-Osqn", "Sentry3-MIB");
if ($debug) { echo($oids."\n"); }
$oids = trim($oids);
$divisor = "10";
$multiplier = "1";
if ($oids) echo("ServerTech Sentry3 Temperature ");
foreach (explode("\n", $oids) as $data)
{
$data = trim($data);
if ($data)
{
list($oid,$descr) = explode(" ", $data,2);
$split_oid = explode('.',$oid);
$index = $split_oid[count($split_oid)-1];
#tempHumidSensorTempValue
$temperature_oid = "1.3.6.1.4.1.1718.3.2.5.1.6.1.".$index;
$descr = "Removable Sensor " . $index;
$low_warn_limit = "0";
$low_limit = snmp_get($device,"tempHumidSensorTempLowThresh.1.$index", "-Ovq", "Sentry3-MIB") / $divisor;
$high_warn_limit = "0";
$high_limit = snmp_get($device,"tempHumidSensorTempHighThresh.1.$index", "-Ovq", "Sentry3-MIB") / $divisor;
$current = snmp_get($device,"$temperature_oid", "-Ovq", "Sentry3-MIB") / $divisor;
discover_sensor($valid_sensor, 'temperature', $device, $temperature_oid, $index, 'sentry3', $descr, $divisor, $multiplier, $low_limit, $low_warn_limit, $high_warn_limit, $high_limit, $current);
}
unset($data);
}
unset($oids);
}
?>
+13
View File
@@ -10,4 +10,17 @@ $version = snmp_get($device, "systemVersion.0", "-Ovq", "Sentry3-MIB");
$version = preg_split('/Sentry\ Switched\ CDU\ Version/', $version); $version = preg_split('/Sentry\ Switched\ CDU\ Version/', $version);
$version = $version[1]; $version = $version[1];
?>
<?php
#Sentry3-MIB::towerModelNumber "CW-24V2-L30M"
#Sentry3-MIB::systemVersion "Sentry Switched CDU Version 6.0g"
#Sentry3-MIB::towerProductSN "ABEF0001561"
$hardware = snmp_get($device, "towerModelNumber.1", "-Ovq", "Sentry3-MIB");
$serial = snmp_get($device, "towerProductSN.1", "-Ovq", "Sentry3-MIB");
$version = snmp_get($device, "systemVersion.0", "-Ovq", "Sentry3-MIB");
$version = preg_split('/Sentry\ Switched\ CDU\ Version/', $version);
$version = $version[1];
?> ?>