diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HoststatusQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HoststatusQuery.php index 171af9785..b4ef3d2ad 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HoststatusQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HoststatusQuery.php @@ -101,17 +101,17 @@ class HoststatusQuery extends IdoQuery 'host_next_notification' => 'UNIX_TIMESTAMP(hs.next_notification)', 'host_next_update' => 'CASE WHEN hs.has_been_checked = 0 OR hs.has_been_checked IS NULL THEN - NULL + CASE hs.should_be_scheduled WHEN 1 THEN UNIX_TIMESTAMP(hs.next_check) + (hs.normal_check_interval * 60) ELSE NULL END ELSE - UNIX_TIMESTAMP(hs.last_check) + UNIX_TIMESTAMP(hs.next_check) + (CASE WHEN COALESCE(hs.current_state, 0) > 0 AND hs.state_type = 0 THEN hs.retry_check_interval ELSE hs.normal_check_interval - END * 60 - + CEIL(hs.execution_time) + CEIL(hs.latency)) * 2 + END * 60) + + (CEIL(hs.execution_time + hs.latency) * 2) END', 'host_no_more_notifications' => 'hs.no_more_notifications', 'host_normal_check_interval' => 'hs.normal_check_interval', diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicestatusQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicestatusQuery.php index 423e588d6..4a59d54d6 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicestatusQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicestatusQuery.php @@ -213,17 +213,17 @@ class ServicestatusQuery extends IdoQuery 'service_next_notification' => 'UNIX_TIMESTAMP(ss.next_notification)', 'service_next_update' => 'CASE WHEN ss.has_been_checked = 0 OR ss.has_been_checked IS NULL THEN - NULL + CASE ss.should_be_scheduled WHEN 1 THEN UNIX_TIMESTAMP(ss.next_check) + (ss.normal_check_interval * 60) ELSE NULL END ELSE - UNIX_TIMESTAMP(ss.last_check) + UNIX_TIMESTAMP(ss.next_check) + (CASE WHEN COALESCE(ss.current_state, 0) > 0 AND ss.state_type = 0 THEN ss.retry_check_interval ELSE ss.normal_check_interval - END * 60 - + CEIL(ss.execution_time) + CEIL(ss.latency)) * 2 + END * 60) + + (CEIL(ss.execution_time + ss.latency) * 2) END', 'service_no_more_notifications' => 'ss.no_more_notifications', 'service_normal_check_interval' => 'ss.normal_check_interval',