Execute event commands only on actively checked host/service objects in an HA zone

fixes #3431
This commit is contained in:
Michael Friedrich 2018-05-11 12:58:33 +02:00
parent b641197361
commit 2d87b667ab
1 changed files with 8 additions and 1 deletions

View File

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