]> granicus.if.org Git - icinga2/commitdiff
Execute event commands only on actively checked host/service objects in an HA zone 6297/head
authorMichael Friedrich <michael.friedrich@icinga.com>
Fri, 11 May 2018 10:58:33 +0000 (12:58 +0200)
committerMichael Friedrich <michael.friedrich@icinga.com>
Fri, 11 May 2018 10:58:33 +0000 (12:58 +0200)
fixes #3431

lib/icinga/checkable-event.cpp

index 12fc926ea8a629499aeafc6e8121fe87c4406e51..494b14cac4b0031f9f5d0bf32841a141d8259204 100644 (file)
@@ -41,13 +41,20 @@ void Checkable::ExecuteEventHandler(const Dictionary::Ptr& resolvedMacros, bool
        if (!IcingaApplication::GetInstance()->GetEnableEventHandlers() || !GetEnableEventHandler())
                return;
 
+       /* HA enabled zones. */
+       if (IsActive() && IsPaused()) {
+               Log(LogNotice, "Checkable")
+                       << "Skipping event handler for HA-paused checkable '" << GetName() << "'";
+               return;
+       }
+
        EventCommand::Ptr ec = GetEventCommand();
 
        if (!ec)
                return;
 
        Log(LogNotice, "Checkable")
-               << "Executing event handler '" << ec->GetName() << "' for service '" << GetName() << "'";
+               << "Executing event handler '" << ec->GetName() << "' for checkable '" << GetName() << "'";
 
        Dictionary::Ptr macros;
        Endpoint::Ptr endpoint = GetCommandEndpoint();