mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
* Sensors remove reliance on global variable * Apply fixes from StyleCI * Clear the instance instead of reset. Remove $valid['sensors'] from docs --------- Co-authored-by: Tony Murray <murrant@users.noreply.github.com>
19 lines
952 B
PHP
19 lines
952 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(null, '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']);
|
|
}
|