]> granicus.if.org Git - icinga2/commitdiff
Bugfixes for the reconnection handler.
authorGunnar Beutner <gunnar.beutner@netways.de>
Mon, 3 Sep 2012 10:20:04 +0000 (12:20 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Mon, 3 Sep 2012 10:20:04 +0000 (12:20 +0200)
icinga/endpointmanager.cpp

index 4bbef5110733a8cbd3ebf7dbd554e9b1d8d21a93..0703fc7554cce2ee951348d0750a295577f31c0e 100644 (file)
@@ -307,15 +307,19 @@ void EndpointManager::ReconnectTimerHandler(void)
        BOOST_FOREACH(tie(tuples::ignore, object), DynamicObject::GetObjects("Endpoint")) {
                Endpoint::Ptr endpoint = dynamic_pointer_cast<Endpoint>(object);
 
-               if (endpoint->IsConnected())
+               if (endpoint->IsConnected() || endpoint == m_Endpoint)
                        continue;
 
                String node, service;
                node = endpoint->GetNode();
                service = endpoint->GetService();
 
-               if (node.IsEmpty() || service.IsEmpty())
+               if (node.IsEmpty() || service.IsEmpty()) {
+                       Logger::Write(LogWarning, "icinga", "Can't reconnect "
+                           "to endpoint '" + endpoint->GetName() + "': No "
+                           "node/service information.");
                        continue;
+               }
 
                AddConnection(node, service);
        }