Files
librenms-librenms/includes/discovery/sensors/temperature/ats.inc.php
TheGreatDoc 5535768d25 New Device: ATS - Automatic Transfer Switch (#9889)
* New Device: ATS - Automatic Transfer Switch

* Small fixes

* Fixed test data

* More fixes, again

* Moved temp to php to retrieve limits from device

* Fixed perms again...

* Final test file. Or I hope so...
2019-03-24 18:48:55 -05:00

19 lines
964 B
PHP

<?php
echo 'ATS Temperature: ';
$descr = 'System';
$oids = [
'atsMiscellaneousGroupAtsSystemTemperture.0',
'emdConfigTempHighSetPoint.0',
'emdConfigTempLowSetPoint.0',
];
$temperature = snmp_get_multi($device, $oids, '-OteQUs', 'ATS-MIB');
if (is_numeric($temperature['0']['atsMiscellaneousGroupAtsSystemTemperture'])) {
$temperature['0']['high_warn'] = $temperature['0']['emdConfigTempHighSetPoint'] - 5;
$temperature['0']['low_warn'] = $temperature['0']['emdConfigTempLowSetPoint'] + 5;
$temperature['0']['oid'] = '.1.3.6.1.4.1.37662.1.2.2.1.1.5.1.0';
discover_sensor($valid['sensor'], 'temperature', $device, $temperature['0']['oid'], 'atsMiscellaneousGroupAtsSystemTemperture', 'ats', 'System', '1', '1', $temperature['0']['emdConfigTempLowSetPoint'], $temperature['0']['low_warn'], $temperature['0']['high_warn'], $temperature['0']['emdConfigTempHighSetPoint'], $temperature['0']['atsMiscellaneousGroupAtsSystemTemperture']);
}