mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Update axis detection (#16130)
* add PTZ and Dome Cameras * remove default temperature limits * set temperature limit per device type * fix linting * add test data * set original limits as default and use integers instead of strings
This commit is contained in:
@@ -2,6 +2,39 @@
|
||||
|
||||
echo 'AXIS Temperatures ';
|
||||
|
||||
// Set Temp Limits based on Device Description
|
||||
switch (true) {
|
||||
case stristr($device['sysDescr'], 'P1425-LE'):
|
||||
$high_limit = 50;
|
||||
$high_warn_limit = 40;
|
||||
$low_warn_limit = -20;
|
||||
$low_limit = -30;
|
||||
break;
|
||||
case stristr($device['sysDescr'], 'P1435-LE'):
|
||||
$high_limit = 60;
|
||||
$high_warn_limit = 50;
|
||||
$low_warn_limit = -20;
|
||||
$low_limit = -30;
|
||||
break;
|
||||
case stristr($device['sysDescr'], 'P1455-LE'):
|
||||
$high_limit = 60;
|
||||
$high_warn_limit = 50;
|
||||
$low_warn_limit = -30;
|
||||
$low_limit = -40;
|
||||
break;
|
||||
case stristr($device['sysDescr'], 'P5676-LE'):
|
||||
$high_limit = 50;
|
||||
$high_warn_limit = 40;
|
||||
$low_warn_limit = -20;
|
||||
$low_limit = -30;
|
||||
break;
|
||||
default:
|
||||
$high_limit = 5;
|
||||
$high_warn_limit = 10;
|
||||
$low_warn_limit = 30;
|
||||
$low_limit = 35;
|
||||
}
|
||||
|
||||
// Temp Sensor Status
|
||||
$oids_tmp = snmpwalk_cache_multi_oid($device, 'tempSensorTable', [], 'AXIS-VIDEO-MIB');
|
||||
$cur_oid = '.1.3.6.1.4.1.368.4.1.3.1.4.1.';
|
||||
@@ -16,5 +49,5 @@ foreach (array_keys($oids) as $index) {
|
||||
$current = $oids[$index]['tempSensorValue'];
|
||||
$oid = $cur_oid . $index;
|
||||
|
||||
discover_sensor($valid['sensor'], 'temperature', $device, $oid, $index, 'axiscam', 'Temperature Sensor ' . $index, '1', '1', '5', '10', '30', '35', $current);
|
||||
discover_sensor($valid['sensor'], 'temperature', $device, $oid, $index, 'axiscam', 'Temperature Sensor ' . $index, '1', '1', $low_limit, $low_warn_limit, $high_warn_limit, $high_limit, $current);
|
||||
}
|
||||
|
Reference in New Issue
Block a user