mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-25 14:44:32 +02:00
Checkable#ProcessCheckResult(): don't overwrite check source
... set by passive check results. refs #7948
This commit is contained in:
parent
ef23ae5f3c
commit
c3eba7e88d
@ -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();
|
||||||
|
|
||||||
|
if (cr->GetCheckSource().IsEmpty()) {
|
||||||
|
if ((!origin || origin->IsLocal()))
|
||||||
|
cr->SetCheckSource(IcingaApplication::GetInstance()->GetNodeName());
|
||||||
|
|
||||||
/* override check source if command_endpoint was defined */
|
/* override check source if command_endpoint was defined */
|
||||||
if (command_endpoint && !GetExtension("agent_check"))
|
if (command_endpoint && !GetExtension("agent_check"))
|
||||||
cr->SetCheckSource(command_endpoint->GetName());
|
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…
x
Reference in New Issue
Block a user