[icinga-checkins] icinga.org: icinga2/master: Ensure to send recovery notifications if the was a problem notification before a downtime

git at icinga.org git at icinga.org
Wed Aug 3 18:29:01 CEST 2016


Module: icinga2
Branch: master
Commit: 34655d77d32c08c1f4d46840b9f4888633855e90
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=34655d77d32c08c1f4d46840b9f4888633855e90

Author: Michael Friedrich <michael.friedrich at netways.de>
Date:   Wed Aug  3 18:28:09 2016 +0200

Ensure to send recovery notifications if the was a problem notification before a downtime

fixes #12293

---

 lib/icinga/checkable-check.cpp |   13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/lib/icinga/checkable-check.cpp b/lib/icinga/checkable-check.cpp
index 831b51a..91cddde 100644
--- a/lib/icinga/checkable-check.cpp
+++ b/lib/icinga/checkable-check.cpp
@@ -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());
 	}
 }
 



More information about the icinga-checkins mailing list