mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
class sensor_descr switch - revert
This commit is contained in:
@@ -196,15 +196,13 @@ function record_sensor_data($device, $all_sensors)
|
||||
);
|
||||
data_update($device, 'sensor', $tags, $fields);
|
||||
|
||||
$descr = $class == $sensor['sensor_descr'] ? $class : "$class {$sensor['sensor_descr']}";
|
||||
|
||||
// FIXME also warn when crossing WARN level!
|
||||
if ($sensor['sensor_limit_low'] != '' && $prev_sensor_value > $sensor['sensor_limit_low'] && $sensor_value < $sensor['sensor_limit_low'] && $sensor['sensor_alert'] == 1) {
|
||||
echo 'Alerting for '.$device['hostname'].' '.$sensor['sensor_descr']."\n";
|
||||
log_event("$descr under threshold: $sensor_value $unit (< {$sensor['sensor_limit_low']} $unit)", $device, $class, 4, $sensor['sensor_id']);
|
||||
log_event("$class under threshold: $sensor_value $unit (< {$sensor['sensor_limit_low']} $unit)", $device, $class, 4, $sensor['sensor_id']);
|
||||
} elseif ($sensor['sensor_limit'] != '' && $prev_sensor_value < $sensor['sensor_limit'] && $sensor_value > $sensor['sensor_limit'] && $sensor['sensor_alert'] == 1) {
|
||||
echo 'Alerting for '.$device['hostname'].' '.$sensor['sensor_descr']."\n";
|
||||
log_event("$descr above threshold: $sensor_value $unit (> {$sensor['sensor_limit']} $unit)", $device, $class, 4, $sensor['sensor_id']);
|
||||
log_event("$class above threshold: $sensor_value $unit (> {$sensor['sensor_limit']} $unit)", $device, $class, 4, $sensor['sensor_id']);
|
||||
}
|
||||
if ($sensor['sensor_class'] == 'state' && $prev_sensor_value != $sensor_value) {
|
||||
$trans = array_column(
|
||||
|
||||
Reference in New Issue
Block a user