mirror of
https://github.com/stylersnico/librenms.git
synced 2026-08-01 16:26:55 +02:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user