Merge pull request #3956 from Icinga/bugfix/checks-wrongly-marked-as-late-3696

Fix checks being marked as late when they are scheduled for later time
This commit is contained in:
Johannes Meyer 2019-10-08 13:39:21 +02:00 committed by GitHub
commit 25e1942a9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

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',

View File

@ -213,17 +213,17 @@ class ServicestatusQuery extends IdoQuery
'service_next_notification' => 'UNIX_TIMESTAMP(ss.next_notification)', '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 'service_next_update' => 'CASE WHEN ss.has_been_checked = 0 OR ss.has_been_checked IS NULL
THEN THEN
NULL CASE ss.should_be_scheduled WHEN 1 THEN UNIX_TIMESTAMP(ss.next_check) + (ss.normal_check_interval * 60) ELSE NULL END
ELSE ELSE
UNIX_TIMESTAMP(ss.last_check) UNIX_TIMESTAMP(ss.next_check)
+ (CASE WHEN + (CASE WHEN
COALESCE(ss.current_state, 0) > 0 AND ss.state_type = 0 COALESCE(ss.current_state, 0) > 0 AND ss.state_type = 0
THEN THEN
ss.retry_check_interval ss.retry_check_interval
ELSE ELSE
ss.normal_check_interval ss.normal_check_interval
END * 60 END * 60)
+ CEIL(ss.execution_time) + CEIL(ss.latency)) * 2 + (CEIL(ss.execution_time + ss.latency) * 2)
END', END',
'service_no_more_notifications' => 'ss.no_more_notifications', 'service_no_more_notifications' => 'ss.no_more_notifications',
'service_normal_check_interval' => 'ss.normal_check_interval', 'service_normal_check_interval' => 'ss.normal_check_interval',