]> granicus.if.org Git - icinga2/commitdiff
Fix: Volatile transitions from HARD NOT-OK->NOT-OK do not trigger notifications
authorMichael Friedrich <michael.friedrich@netways.de>
Fri, 11 Mar 2016 12:19:03 +0000 (13:19 +0100)
committerMichael Friedrich <michael.friedrich@netways.de>
Fri, 11 Mar 2016 12:19:03 +0000 (13:19 +0100)
fixes #11320

lib/icinga/checkable-check.cpp

index 819de82971f5b41f155982e0cfbacebd77430b11..90590fb52387ecf3eb3f54ee6a3e6720ba6ea451 100644 (file)
@@ -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 */