From 9bdf2f47668c3c5938e1fbccfac2dc327f1d170b Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Thu, 20 Feb 2014 10:32:11 +0100 Subject: [PATCH] Event handlers should be run when services are in a soft state. Fixes #5681 --- lib/icinga/service-check.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/icinga/service-check.cpp b/lib/icinga/service-check.cpp index 3e43fc81c..84cd41a4c 100644 --- a/lib/icinga/service-check.cpp +++ b/lib/icinga/service-check.cpp @@ -307,7 +307,6 @@ void Service::ProcessCheckResult(const CheckResult::Ptr& cr, const String& autho SetState(cr->GetState()); - bool call_eventhandler = false; bool stateChange = (old_state != GetState()); if (stateChange) { SetLastStateChange(now); @@ -333,8 +332,6 @@ void Service::ProcessCheckResult(const CheckResult::Ptr& cr, const String& autho service->SetNextCheck(Utility::GetTime()); } } - - call_eventhandler = true; } bool remove_acknowledgement_comments = false; @@ -412,7 +409,7 @@ void Service::ProcessCheckResult(const CheckResult::Ptr& cr, const String& autho else if (stateChange) OnStateChange(GetSelf(), cr, StateTypeSoft, authority); - if (call_eventhandler) + if (GetStateType() == StateTypeSoft || hardChange || recovery) ExecuteEventHandler(); if (send_downtime_notification)