mirror of https://github.com/Icinga/icinga2.git
Execute event commands only on actively checked host/service objects in an HA zone
fixes #3431
This commit is contained in:
parent
b641197361
commit
2d87b667ab
|
@ -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();
|
||||||
|
|
Loading…
Reference in New Issue