mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
only add new outage entry if Device status changed (#12309)
* only add new outage entry if Device status changed * .
This commit is contained in:
@@ -2072,11 +2072,13 @@ function device_is_up($device, $record_perf = false)
|
||||
$type = 'down';
|
||||
$reason = $response['status_reason'];
|
||||
|
||||
if (! $consider_maintenance || (! $maintenance && $consider_maintenance)) {
|
||||
// use current time as a starting point when an outage starts
|
||||
$data = ['device_id' => $device['device_id'],
|
||||
'going_down' => time(), ];
|
||||
dbInsert($data, 'device_outages');
|
||||
if ($device['status'] != $response['status']) {
|
||||
if (! $consider_maintenance || (! $maintenance && $consider_maintenance)) {
|
||||
// use current time as a starting point when an outage starts
|
||||
$data = ['device_id' => $device['device_id'],
|
||||
'going_down' => time(), ];
|
||||
dbInsert($data, 'device_outages');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user