From 2d87b667ab9c8dd40a6f5be5ca1793fa2a590e45 Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Fri, 11 May 2018 12:58:33 +0200 Subject: [PATCH] Execute event commands only on actively checked host/service objects in an HA zone fixes #3431 --- lib/icinga/checkable-event.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/icinga/checkable-event.cpp b/lib/icinga/checkable-event.cpp index 12fc926ea..494b14cac 100644 --- a/lib/icinga/checkable-event.cpp +++ b/lib/icinga/checkable-event.cpp @@ -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(); -- 2.40.0