From a9602371395e917bc0029966b29e74820cd1de80 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Wed, 27 Feb 2013 16:57:06 +0100 Subject: [PATCH] Fixed recovery notifications (again). --- lib/icinga/service-check.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/icinga/service-check.cpp b/lib/icinga/service-check.cpp index 72a344071..da7cf179a 100644 --- a/lib/icinga/service-check.cpp +++ b/lib/icinga/service-check.cpp @@ -254,11 +254,14 @@ void Service::ApplyCheckResult(const Dictionary::Ptr& cr) long attempt = GetCurrentCheckAttempt(); if (cr->Get("state") == StateOK) { + if (old_state != StateOK && old_stateType == StateTypeHard) + SetStateType(StateTypeSoft); // HARD NON-OK -> SOFT OK + if (old_state == StateOK && old_stateType == StateTypeSoft) - hardChange = true; // hard recovery + hardChange = true; // SOFT OK -> HARD OK if (old_state == StateOK || old_stateType == StateTypeSoft) - SetStateType(StateTypeHard); + SetStateType(StateTypeHard); // SOFT OK -> HARD OK or SOFT NON-OK -> HARD OK attempt = 1; recovery = true;