[icinga-checkins] icinga.org: icinga2/master: Fix: First HARD state does not change retry_interval to check_interval

git at icinga.org git at icinga.org
Sat May 21 18:59:28 CEST 2016


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

Author: Michael Friedrich <michael.friedrich at netways.de>
Date:   Sat May 21 18:58:19 2016 +0200

Fix: First HARD state does not change retry_interval to check_interval

refs #11825

---

 lib/icinga/checkable-check.cpp |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lib/icinga/checkable-check.cpp b/lib/icinga/checkable-check.cpp
index 4151e16..7d129fd 100644
--- a/lib/icinga/checkable-check.cpp
+++ b/lib/icinga/checkable-check.cpp
@@ -329,8 +329,14 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig
 		/* If there was a OK -> NOT-OK state change for actively scheduled checks,
 		 * update the next check time using the retry_interval.
 		 * Important: Add the cluster message origin. */
-		if (GetStateType() == StateTypeSoft)
+		if (GetStateType() == StateTypeSoft) {
 			UpdateNextCheck(origin);
+		} else if (hardChange) {
+			/* A hard state change must enforce the check interval again.
+			 * UpdateNextCheck() will use the scheduling offset which generates
+			 * an incorrect check time from the previous retry interval. */
+			SetNextCheck(Utility::GetTime() + GetCheckInterval(), false, origin);
+		}
 	} else {
 		/* Reschedule the next check for passive check results. The side effect of
 		 * this is that for as long as we receive passive results for a service we



More information about the icinga-checkins mailing list