diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicestatusQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicestatusQuery.php index 01e44bea7..3d2c0447c 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicestatusQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicestatusQuery.php @@ -194,6 +194,39 @@ class ServicestatusQuery extends IdoQuery 'service_modified_service_attributes' => 'ss.modified_service_attributes', 'service_next_check' => 'UNIX_TIMESTAMP(ss.next_check)', '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 + ELSE + UNIX_TIMESTAMP(ss.last_check) + + CASE WHEN + COALESCE(ss.current_state, 0) = 0 + THEN + ss.normal_check_interval + ELSE + ss.retry_check_interval + END * 60 + + FLOOR(ss.execution_time) * 2 + END', + // TODO(el): Remove column once we support service_expected_update>now + 'service_next_update_is_late' => 'CASE WHEN ss.has_been_checked = 0 OR ss.has_been_checked IS NULL + THEN + 0 + ELSE + CASE WHEN (UNIX_TIMESTAMP(ss.last_check) + + CASE WHEN COALESCE(ss.current_state, 0) = 0 + THEN + ss.normal_check_interval + ELSE + ss.retry_check_interval + END * 60 + + FLOOR(ss.execution_time) * 2) > CURRENT_TIMESTAMP() + THEN + 1 + ELSE + 0 + END + END', 'service_no_more_notifications' => 'ss.no_more_notifications', 'service_normal_check_interval' => 'ss.normal_check_interval', 'service_notifications_enabled' => 'ss.notifications_enabled',