mirror of
https://github.com/librenms/librenms.git
synced 2024-09-21 02:18:39 +00:00
Sensor: Only post to eventlog when specific columns change (#16370)
This commit is contained in:
parent
f54e38f4fe
commit
3da691277a
@ -122,7 +122,10 @@ class SensorObserver
|
||||
echo 'U';
|
||||
}
|
||||
|
||||
EventLog::log('Sensor Updated: ' . $sensor->sensor_class . ' ' . $sensor->sensor_type . ' ' . $sensor->sensor_index . ' ' . $sensor->sensor_descr, $sensor->device_id, 'sensor', Severity::Notice, $sensor->sensor_id);
|
||||
// only post eventlog when relevant columns change
|
||||
if ($sensor->isDirty(['sensor_class', 'sensor_oid', 'sensor_index', 'sensor_type', 'sensor_descr', 'group', 'sensor_divisor', 'sensor_multiplier', 'entPhysicalIndex', 'entPhysicalIndex_measured', 'user_func'])) {
|
||||
EventLog::log('Sensor Updated: ' . $sensor->sensor_class . ' ' . $sensor->sensor_type . ' ' . $sensor->sensor_index . ' ' . $sensor->sensor_descr, $sensor->device_id, 'sensor', Severity::Notice, $sensor->sensor_id);
|
||||
}
|
||||
}
|
||||
|
||||
public function deleted(): void
|
||||
|
Loading…
Reference in New Issue
Block a user