[icinga-checkins] icinga.org: icinga2/master: Fixed recovery notifications (again).

git at icinga.org git at icinga.org
Wed Feb 27 16:57:15 CET 2013


Module: icinga2
Branch: master
Commit: a9602371395e917bc0029966b29e74820cd1de80
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=a9602371395e917bc0029966b29e74820cd1de80

Author: Gunnar Beutner <gunnar.beutner at netways.de>
Date:   Wed Feb 27 16:57:06 2013 +0100

Fixed recovery notifications (again).

---

 lib/icinga/service-check.cpp |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/icinga/service-check.cpp b/lib/icinga/service-check.cpp
index 72a3440..da7cf17 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;





More information about the icinga-checkins mailing list