Fix: Volatile transitions from HARD NOT-OK->NOT-OK do not trigger notifications

fixes #11320
This commit is contained in:
Michael Friedrich 2016-03-11 13:19:03 +01:00
parent f99feab08c
commit 7ad7e28d7a
1 changed files with 11 additions and 1 deletions

View File

@ -262,7 +262,17 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig
Checkable::UpdateStatistics(cr, checkable_type); Checkable::UpdateStatistics(cr, checkable_type);
bool in_downtime = IsInDowntime(); 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) if (!old_cr)
send_notification = false; /* Don't send notifications for the initial state change */ send_notification = false; /* Don't send notifications for the initial state change */