mirror of https://github.com/Icinga/icinga2.git
parent
8e73d72447
commit
10441e9cd7
|
@ -193,7 +193,10 @@ Value ApiEvents::CheckResultAPIHandler(const MessageOrigin& origin, const Dictio
|
||||||
if (origin.FromZone && !origin.FromZone->CanAccessObject(checkable) && endpoint != checkable->GetCommandEndpoint())
|
if (origin.FromZone && !origin.FromZone->CanAccessObject(checkable) && endpoint != checkable->GetCommandEndpoint())
|
||||||
return Empty;
|
return Empty;
|
||||||
|
|
||||||
checkable->ProcessCheckResult(cr, origin);
|
if (endpoint == checkable->GetCommandEndpoint())
|
||||||
|
checkable->ProcessCheckResult(cr);
|
||||||
|
else
|
||||||
|
checkable->ProcessCheckResult(cr, origin);
|
||||||
|
|
||||||
return Empty;
|
return Empty;
|
||||||
}
|
}
|
||||||
|
|
|
@ -268,25 +268,6 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig
|
||||||
/* send message back to its origin */
|
/* send message back to its origin */
|
||||||
Dictionary::Ptr message = ApiEvents::MakeCheckResultMessage(this, cr);
|
Dictionary::Ptr message = ApiEvents::MakeCheckResultMessage(this, cr);
|
||||||
listener->SyncSendMessage(command_endpoint, message);
|
listener->SyncSendMessage(command_endpoint, message);
|
||||||
|
|
||||||
/* HA cluster zone nodes must also process the check result locally
|
|
||||||
* by fetching the real host/service object if existing
|
|
||||||
*/
|
|
||||||
Host::Ptr tempHost;
|
|
||||||
Service::Ptr tempService;
|
|
||||||
tie(tempHost, tempService) = GetHostService(this);
|
|
||||||
Host::Ptr realHost = Host::GetByName(tempHost->GetName());
|
|
||||||
if (realHost) {
|
|
||||||
Value agent_service_name = GetExtension("agent_service_name");
|
|
||||||
if (!agent_service_name.IsEmpty()) {
|
|
||||||
Checkable::Ptr realCheckable;
|
|
||||||
realCheckable = realHost->GetServiceByShortName(agent_service_name);
|
|
||||||
if (realCheckable) {
|
|
||||||
realCheckable->ProcessCheckResult(cr, origin);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue