mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
dcf48ae16d
git-svn-id: http://www.observium.org/svn/observer/trunk@2854 61d68cd4-352d-0410-923a-c4978735b2b8
26 lines
798 B
PHP
26 lines
798 B
PHP
<?php
|
|
|
|
if ($device['os'] == "avaya-ers")
|
|
{
|
|
# Get major version number of running firmware
|
|
$fw_major_version = Null;
|
|
preg_match("/[0-9]\.[0-9]/", $device['version'], $fw_major_version);
|
|
$fw_major_version = $fw_major_version[0];
|
|
|
|
# Temperature info only known to be present in firmware 6.1 or higher
|
|
if ($fw_major_version >= 6.1) {
|
|
$temps = snmp_walk($device, "1.3.6.1.4.1.45.1.6.3.7.1.1.5.5", "-Osqn");
|
|
|
|
foreach (explode("\n", $temps) as $i => $t) {
|
|
$t = explode(" ",$t);
|
|
$oid = $t[0];
|
|
$val = $t[1];
|
|
# Sensors are reported as 2 * value
|
|
$val = trim($val) / 2;
|
|
discover_sensor($valid['sensor'], 'temperature', $device, $oid, zeropad($i+1), 'avaya-ers', "Unit " . ($i+1) . " temperature", '2', '1', NULL, NULL, NULL, NULL, $val);
|
|
}
|
|
}
|
|
}
|
|
|
|
?>
|