Skip to content

Commit

Permalink
Fix: Volatile transitions from HARD NOT-OK->NOT-OK do not trigger not…
Browse files Browse the repository at this point in the history
…ifications

fixes #11320
  • Loading branch information
Michael Friedrich committed Mar 11, 2016
1 parent 7fb8bcd commit 3e050bd
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/icinga/checkable-check.cpp
Expand Up @@ -287,7 +287,17 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig
Checkable::UpdateStatistics(cr, checkableType);

bool in_downtime = IsInDowntime();
bool send_notification = hardChange && notification_reachable && !in_downtime && !IsAcknowledged();

bool send_notification = false;

if (notification_reachable && !in_downtime && !IsAcknowledged()) {
/* Send notifications whether when a hard state change occured. */
if (hardChange)
send_notification = true;
/* Or if the checkable is volatile and in a HARD state. */
else if (is_volatile && GetStateType() == StateTypeHard)
send_notification = true;
}

if (!old_cr)
send_notification = false; /* Don't send notifications for the initial state change */
Expand Down

0 comments on commit 3e050bd

Please sign in to comment.