From: Gunnar Beutner Date: Wed, 27 Feb 2013 15:57:06 +0000 (+0100) Subject: Fixed recovery notifications (again). X-Git-Tag: v0.0.2~355 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a9602371395e917bc0029966b29e74820cd1de80;p=icinga2 Fixed recovery notifications (again). --- 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;