HoststatusQuery: Adjust next_update calculation to respect next_check

This commit is contained in:
Johannes Meyer 2019-09-26 15:10:25 +02:00
parent 2979ad1da0
commit b9ea432d35

View File

@ -101,17 +101,17 @@ class HoststatusQuery extends IdoQuery
'host_next_notification' => 'UNIX_TIMESTAMP(hs.next_notification)', '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 'host_next_update' => 'CASE WHEN hs.has_been_checked = 0 OR hs.has_been_checked IS NULL
THEN THEN
NULL CASE hs.should_be_scheduled WHEN 1 THEN UNIX_TIMESTAMP(hs.next_check) + (hs.normal_check_interval * 60) ELSE NULL END
ELSE ELSE
UNIX_TIMESTAMP(hs.last_check) UNIX_TIMESTAMP(hs.next_check)
+ (CASE WHEN + (CASE WHEN
COALESCE(hs.current_state, 0) > 0 AND hs.state_type = 0 COALESCE(hs.current_state, 0) > 0 AND hs.state_type = 0
THEN THEN
hs.retry_check_interval hs.retry_check_interval
ELSE ELSE
hs.normal_check_interval hs.normal_check_interval
END * 60 END * 60)
+ CEIL(hs.execution_time) + CEIL(hs.latency)) * 2 + (CEIL(hs.execution_time + hs.latency) * 2)
END', END',
'host_no_more_notifications' => 'hs.no_more_notifications', 'host_no_more_notifications' => 'hs.no_more_notifications',
'host_normal_check_interval' => 'hs.normal_check_interval', 'host_normal_check_interval' => 'hs.normal_check_interval',