Skip to content

Commit

Permalink
Wait until the next check result if it's expected to arrive soon befo…
Browse files Browse the repository at this point in the history
…re re-sending a suppressed notification

refs #5919
  • Loading branch information
Al2Klimov committed Jul 3, 2019
1 parent bfcd278 commit 390ae61
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/icinga/checkable-notification.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,17 @@ static void FireSuppressedNotifications(Checkable* checkable)
still_suppressed = checkable->IsInDowntime();
}

if (!still_suppressed && checkable->GetEnableActiveChecks()) {
auto threshold (checkable->GetCheckInterval() - 10);

if (threshold > 60)
threshold = 60;
else if (threshold < 0)
threshold = 0;

still_suppressed = checkable->GetNextCheck() <= Utility::GetTime() + threshold;
}

if (!still_suppressed) {
Checkable::OnNotificationsRequested(checkable, type, cr, "", "", nullptr);

Expand Down

0 comments on commit 390ae61

Please sign in to comment.