mirror of https://github.com/Icinga/icinga2.git
Merge pull request #8158 from Icinga/bugfix/check-source-passive-7948
Checkable#ProcessCheckResult(): don't overwrite check source
This commit is contained in:
commit
9219f68c83
|
@ -118,14 +118,16 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig
|
||||||
if (cr->GetExecutionEnd() == 0)
|
if (cr->GetExecutionEnd() == 0)
|
||||||
cr->SetExecutionEnd(now);
|
cr->SetExecutionEnd(now);
|
||||||
|
|
||||||
if (!origin || origin->IsLocal())
|
|
||||||
cr->SetCheckSource(IcingaApplication::GetInstance()->GetNodeName());
|
|
||||||
|
|
||||||
Endpoint::Ptr command_endpoint = GetCommandEndpoint();
|
Endpoint::Ptr command_endpoint = GetCommandEndpoint();
|
||||||
|
|
||||||
/* override check source if command_endpoint was defined */
|
if (cr->GetCheckSource().IsEmpty()) {
|
||||||
if (command_endpoint && !GetExtension("agent_check"))
|
if ((!origin || origin->IsLocal()))
|
||||||
cr->SetCheckSource(command_endpoint->GetName());
|
cr->SetCheckSource(IcingaApplication::GetInstance()->GetNodeName());
|
||||||
|
|
||||||
|
/* override check source if command_endpoint was defined */
|
||||||
|
if (command_endpoint && !GetExtension("agent_check"))
|
||||||
|
cr->SetCheckSource(command_endpoint->GetName());
|
||||||
|
}
|
||||||
|
|
||||||
/* agent checks go through the api */
|
/* agent checks go through the api */
|
||||||
if (command_endpoint && GetExtension("agent_check")) {
|
if (command_endpoint && GetExtension("agent_check")) {
|
||||||
|
|
Loading…
Reference in New Issue