From bd37b9b62f2c845f4840032303e427997e083255 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Mon, 10 Mar 2014 08:56:31 +0100 Subject: [PATCH] Fix: Check attempt counter is invalid. Fixes #5734 --- lib/icinga/service-check.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/icinga/service-check.cpp b/lib/icinga/service-check.cpp index ca9f4795b..fd5ac59c1 100644 --- a/lib/icinga/service-check.cpp +++ b/lib/icinga/service-check.cpp @@ -262,7 +262,7 @@ void Service::ProcessCheckResult(const CheckResult::Ptr& cr, const String& autho SetLastStateType(old_stateType); SetLastReachable(reachable); - long attempt; + long attempt = 1; if (!old_cr) { SetStateType(StateTypeHard); @@ -270,14 +270,12 @@ void Service::ProcessCheckResult(const CheckResult::Ptr& cr, const String& autho if (old_state == StateOK && old_stateType == StateTypeSoft) SetStateType(StateTypeHard); // SOFT OK -> HARD OK - attempt = 1; recovery = true; ResetNotificationNumbers(); SetLastStateOK(Utility::GetTime()); } else { if (old_attempt >= GetMaxCheckAttempts()) { SetStateType(StateTypeHard); - attempt = 1; } else if (GetStateType() == StateTypeSoft || GetState() == StateOK) { SetStateType(StateTypeSoft); attempt = old_attempt + 1; -- 2.40.0