From 05c237c780d4cdbce4ad844febec0d012cf7796f Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Fri, 20 Feb 2015 21:30:14 +0100 Subject: [PATCH] Don't increment check attempt counter on OK->NOT-OK transition refs #7287 Signed-off-by: Michael Friedrich --- lib/icinga/checkable-check.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/icinga/checkable-check.cpp b/lib/icinga/checkable-check.cpp index a4da0c31d..0688e93fb 100644 --- a/lib/icinga/checkable-check.cpp +++ b/lib/icinga/checkable-check.cpp @@ -338,9 +338,12 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig } else { if (old_attempt >= GetMaxCheckAttempts()) { SetStateType(StateTypeHard); - } else if (old_stateType == StateTypeSoft || old_state == ServiceOK) { + } else if (old_stateType == StateTypeSoft && old_state != ServiceOK) { SetStateType(StateTypeSoft); - attempt = old_attempt + 1; + attempt = old_attempt + 1; //NOT-OK -> NOT-OK counter + } else if (old_state == ServiceOK) { + SetStateType(StateTypeSoft); + attempt = 1; //OK -> NOT-OK transition, reset the counter } else { attempt = old_attempt; }