]> granicus.if.org Git - icinga2/commitdiff
Event handlers should be run when services are in a soft state.
authorGunnar Beutner <gunnar.beutner@netways.de>
Thu, 20 Feb 2014 09:32:11 +0000 (10:32 +0100)
committerGunnar Beutner <gunnar.beutner@netways.de>
Thu, 20 Feb 2014 09:35:58 +0000 (10:35 +0100)
Fixes #5681

lib/icinga/service-check.cpp

index 3e43fc81ccbfdbea92565ba2314c3880f4f708fc..84cd41a4cea8c03fd6aa5dd6981d3673a031f53c 100644 (file)
@@ -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)