]> granicus.if.org Git - icinga2/commitdiff
Ensure to send recovery notifications if the was a problem notification before a...
authorMichael Friedrich <michael.friedrich@netways.de>
Wed, 3 Aug 2016 16:28:09 +0000 (18:28 +0200)
committerMichael Friedrich <michael.friedrich@netways.de>
Wed, 3 Aug 2016 16:28:09 +0000 (18:28 +0200)
fixes #12293

lib/icinga/checkable-check.cpp

index 831b51a17970ddd28793dc6e90bb281210b03aad..91cdddea0d0e3d0cd1a606ce9a505c19a1cdc740 100644 (file)
@@ -389,10 +389,17 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig
                NotifyFlapping(origin);
        }
 
-       /* Problem notifications */
-       if (send_notification && !is_flapping) {
+       if (recovery) {
+               /* Recovery notifications must be sent any time.
+                * Users who where notified about a problem before
+                * will be filtered when processing the notification.
+                */
                if (!IsPaused())
-                       OnNotificationsRequested(this, recovery ? NotificationRecovery : NotificationProblem, cr, "", "", MessageOrigin::Ptr());
+                       OnNotificationsRequested(this, NotificationRecovery, cr, "", "", MessageOrigin::Ptr());
+       } else if (send_notification && !is_flapping) {
+               /* Problem notifications */
+               if (!IsPaused())
+                       OnNotificationsRequested(this, NotificationProblem, cr, "", "", MessageOrigin::Ptr());
        }
 }