]> granicus.if.org Git - icinga2/commitdiff
Add log message for heartbeat timeouts
authorGunnar Beutner <gunnar.beutner@netways.de>
Wed, 10 Dec 2014 08:56:32 +0000 (09:56 +0100)
committerGunnar Beutner <gunnar.beutner@netways.de>
Wed, 10 Dec 2014 08:57:08 +0000 (09:57 +0100)
refs #7745

lib/remote/apiclient-heartbeat.cpp

index 427a0a19caf6799c4bebd3bdaf117fad66cadfea..de7b9bc57fb680a3b8453d2e20b59103d458b781 100644 (file)
@@ -22,6 +22,7 @@
 #include "remote/apifunction.hpp"
 #include "base/initialize.hpp"
 #include "base/dynamictype.hpp"
+#include "base/logger.hpp"
 #include <boost/foreach.hpp>
 
 using namespace icinga;
@@ -45,6 +46,10 @@ void ApiClient::HeartbeatTimerHandler(void)
        BOOST_FOREACH(const Endpoint::Ptr& endpoint, DynamicType::GetObjectsByType<Endpoint>()) {
                BOOST_FOREACH(const ApiClient::Ptr& client, endpoint->GetClients()) {
                        if (client->m_NextHeartbeat != 0 && client->m_NextHeartbeat < Utility::GetTime()) {
+                               Log(LogWarning, "ApiClient")
+                                   << "Client for endpoint '" << endpoint->GetName() << "' has requested "
+                                   << "heartbeat message but hasn't responded in time. Closing connection.";
+
                                client->Disconnect();
                                continue;
                        }