From: Michael Friedrich Date: Fri, 11 Mar 2016 12:19:03 +0000 (+0100) Subject: Fix: Volatile transitions from HARD NOT-OK->NOT-OK do not trigger notifications X-Git-Tag: v2.4.4~19 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7ad7e28d7a0b5826b74e066399dab1157f44fc6d;p=icinga2 Fix: Volatile transitions from HARD NOT-OK->NOT-OK do not trigger notifications fixes #11320 --- diff --git a/lib/icinga/checkable-check.cpp b/lib/icinga/checkable-check.cpp index 398b8dfbe..f1c547793 100644 --- a/lib/icinga/checkable-check.cpp +++ b/lib/icinga/checkable-check.cpp @@ -262,7 +262,17 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig Checkable::UpdateStatistics(cr, checkable_type); 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 */