diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HoststatusQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HoststatusQuery.php index 2cfa6c129..e3e00b1a7 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HoststatusQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HoststatusQuery.php @@ -83,32 +83,13 @@ class HoststatusQuery extends IdoQuery ELSE UNIX_TIMESTAMP(hs.last_check) + CASE WHEN - COALESCE(hs.current_state, 0) = 0 + COALESCE(hs.current_state, 0) > 0 AND hs.state_type = 0 THEN - hs.normal_check_interval - ELSE hs.retry_check_interval - END * 60 - + FLOOR(hs.execution_time) * 2 - END', - // TODO(el): Remove column once we support host_next_update>now - 'host_next_update_is_late' => 'CASE WHEN hs.has_been_checked = 0 OR hs.has_been_checked IS NULL - THEN - 0 - ELSE - CASE WHEN (UNIX_TIMESTAMP(hs.last_check) - + CASE WHEN COALESCE(hs.current_state, 0) = 0 - THEN - hs.normal_check_interval - ELSE - hs.retry_check_interval - END * 60 - + FLOOR(hs.execution_time) * 2) > CURRENT_TIMESTAMP() - THEN - 1 ELSE - 0 - END + hs.normal_check_interval + END * 60 + + CEIL(hs.execution_time) * 2 END', 'host_no_more_notifications' => 'hs.no_more_notifications', 'host_normal_check_interval' => 'hs.normal_check_interval',