diff --git a/includes/functions.php b/includes/functions.php index 91071a69992e..c239298e3dfc 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -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'); + } } }