]> granicus.if.org Git - icinga2/commitdiff
Fixed recovery notifications (again).
authorGunnar Beutner <gunnar.beutner@netways.de>
Wed, 27 Feb 2013 15:57:06 +0000 (16:57 +0100)
committerGunnar Beutner <gunnar.beutner@netways.de>
Wed, 27 Feb 2013 15:57:06 +0000 (16:57 +0100)
lib/icinga/service-check.cpp

index 72a3440717c4bd2f5af50c2b25f8018fad3383cb..da7cf179a25ae6e1cdce62cc60ff872f687d1c3c 100644 (file)
@@ -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;