]> granicus.if.org Git - icinga2/commitdiff
Bugfix: The delegation component should use only non-local checker endpoints.
authorGunnar Beutner <gunnar.beutner@netways.de>
Fri, 12 Oct 2012 08:33:11 +0000 (10:33 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Fri, 12 Oct 2012 08:33:11 +0000 (10:33 +0200)
components/delegation/delegationcomponent.cpp

index 7acbccd82e6862441918b19db681a683e58618f3..a345ae03834b0d711a8e82e30011c80e61a60063 100644 (file)
@@ -44,8 +44,13 @@ vector<Endpoint::Ptr> DelegationComponent::GetCheckerCandidates(const Service::P
        BOOST_FOREACH(tie(tuples::ignore, object), DynamicObject::GetObjects("Endpoint")) {
                Endpoint::Ptr endpoint = dynamic_pointer_cast<Endpoint>(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<Endpoint>(object);
 
+               if (endpoint->IsLocal())
+                       continue;
+
                histogram[endpoint] = 0;
        }