[icinga-checkins] icinga.org: icinga2/fix/api-sync-repl-11684: DB IDO: Ensure that SOFT state changes with the same state are logged

git at icinga.org git at icinga.org
Wed Jun 15 17:50:19 CEST 2016


Module: icinga2
Branch: fix/api-sync-repl-11684
Commit: f7f976b962661a3dc38a122d4ee0a967dd6518d2
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=f7f976b962661a3dc38a122d4ee0a967dd6518d2

Author: Michael Friedrich <michael.friedrich at netways.de>
Date:   Mon Jun 13 10:09:18 2016 +0200

DB IDO: Ensure that SOFT state changes with the same state are logged

fixes #11933

---

 lib/icinga/checkable-check.cpp |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/icinga/checkable-check.cpp b/lib/icinga/checkable-check.cpp
index 4e64d92..0fe57af 100644
--- a/lib/icinga/checkable-check.cpp
+++ b/lib/icinga/checkable-check.cpp
@@ -355,7 +355,9 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig
 		OnStateChange(this, cr, StateTypeHard, origin);
 		Log(LogNotice, "Checkable")
 		    << "State Change: Checkable " << GetName() << " hard state change from " << old_state_str << " to " << new_state_str << " detected." << (is_volatile ? " Checkable is volatile." : "");
-	} else if (stateChange) {
+	}
+	/* Whether a state change happened or the state type is SOFT (must be logged too). */
+	else if (stateChange || GetStateType() == StateTypeSoft) {
 		OnStateChange(this, cr, StateTypeSoft, origin);
 		Log(LogNotice, "Checkable")
 		    << "State Change: Checkable " << GetName() << " soft state change from " << old_state_str << " to " << new_state_str << " detected.";



More information about the icinga-checkins mailing list