[icinga-checkins] icinga.org: icinga2/support/2.5: Fix Flapping{Start, End} notifications in SOFT states or downtimes

git at icinga.org git at icinga.org
Thu Nov 17 13:51:08 CET 2016


Module: icinga2
Branch: support/2.5
Commit: 0610652e369e1093dfe80150bd9c13ee894fe351
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=0610652e369e1093dfe80150bd9c13ee894fe351

Author: Michael Friedrich <michael.friedrich at icinga.com>
Date:   Thu Nov 10 14:02:02 2016 +0100

Fix Flapping{Start,End} notifications in SOFT states or downtimes

fixes #12560
fixes #12892

---

 lib/icinga/checkable-check.cpp |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/icinga/checkable-check.cpp b/lib/icinga/checkable-check.cpp
index 00e4823..3c95727 100644
--- a/lib/icinga/checkable-check.cpp
+++ b/lib/icinga/checkable-check.cpp
@@ -365,7 +365,8 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig
 		ExecuteEventHandler();
 
 	/* Flapping start/end notifications */
-	if (!was_flapping && is_flapping) {
+	if (send_notification && !was_flapping && is_flapping) {
+		/* FlappingStart notifications happen on state changes, not in downtimes */
 		if (!IsPaused())
 			OnNotificationsRequested(this, NotificationFlappingStart, cr, "", "", MessageOrigin::Ptr());
 
@@ -373,7 +374,8 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig
 			<< "Flapping: Checkable " << GetName() << " started flapping (" << GetFlappingThreshold() << "% < " << GetFlappingCurrent() << "%).";
 
 		NotifyFlapping(origin);
-	} else if (was_flapping && !is_flapping) {
+	} else if (!in_downtime && was_flapping && !is_flapping) {
+		/* FlappingEnd notifications are independent from state changes, must not happen in downtine */
 		if (!IsPaused())
 			OnNotificationsRequested(this, NotificationFlappingEnd, cr, "", "", MessageOrigin::Ptr());
 



More information about the icinga-checkins mailing list