From: Gunnar Beutner Date: Fri, 12 Oct 2012 08:33:11 +0000 (+0200) Subject: Bugfix: The delegation component should use only non-local checker endpoints. X-Git-Tag: v0.0.1~21 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=26da51e0713bf2f70df626d377b6355ef255422d;p=icinga2 Bugfix: The delegation component should use only non-local checker endpoints. --- diff --git a/components/delegation/delegationcomponent.cpp b/components/delegation/delegationcomponent.cpp index 7acbccd82..a345ae038 100644 --- a/components/delegation/delegationcomponent.cpp +++ b/components/delegation/delegationcomponent.cpp @@ -44,8 +44,13 @@ vector DelegationComponent::GetCheckerCandidates(const Service::P BOOST_FOREACH(tie(tuples::ignore, object), DynamicObject::GetObjects("Endpoint")) { Endpoint::Ptr endpoint = dynamic_pointer_cast(object); + /* ignore local-only endpoints */ + if (endpoint->IsLocal()) + continue; + /* ignore disconnected endpoints */ - if (!endpoint->IsConnected()) + if (!endpoint->IsConnected() && + endpoint->GetName() != EndpointManager::GetInstance()->GetIdentity()) continue; /* ignore endpoints that aren't running the checker component */ @@ -70,6 +75,9 @@ void DelegationComponent::DelegationTimerHandler(void) BOOST_FOREACH(tie(tuples::ignore, object), DynamicObject::GetObjects("Endpoint")) { Endpoint::Ptr endpoint = dynamic_pointer_cast(object); + if (endpoint->IsLocal()) + continue; + histogram[endpoint] = 0; }