mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
git-svn-id: http://www.observium.org/svn/observer/trunk@1837 61d68cd4-352d-0410-923a-c4978735b2b8
28 lines
925 B
PHP
28 lines
925 B
PHP
<?php
|
|
|
|
global $valid_sensor;
|
|
|
|
if ($device['os'] == "netmanplus" || $device['os'] == 'deltaups')
|
|
{
|
|
$oids = snmp_walk($device, "1.3.6.1.2.1.33.1.2.7", "-Osqn", "UPS-MIB");
|
|
if ($debug) { echo($oids."\n"); }
|
|
$oids = trim($oids);
|
|
if ($oids) echo("RFC1628 Battery Temperature ");
|
|
foreach (explode("\n", $oids) as $data)
|
|
{
|
|
$data = trim($data);
|
|
if ($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.2.1.33.1.2.7.$temperature_id";
|
|
$temperature = snmp_get($device, $temperature_oid, "-Ovq");
|
|
$descr = "Battery" . (count(explode("\n",$oids)) == 1 ? '' : ' ' . ($temperature_id+1));
|
|
|
|
discover_sensor($valid_sensor, 'temperature', $device, $temperature_oid, $temperature_id, 'rfc1628', $descr, '1', '1', NULL, NULL, NULL, NULL, $temperature);
|
|
}
|
|
}
|
|
}
|
|
|
|
?>
|