From c70623ec7cdb5381256a181d5986b8cbc0ebcf05 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Wed, 10 Dec 2014 09:56:32 +0100 Subject: [PATCH] Add log message for heartbeat timeouts refs #7745 --- lib/remote/apiclient-heartbeat.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/remote/apiclient-heartbeat.cpp b/lib/remote/apiclient-heartbeat.cpp index 427a0a19c..de7b9bc57 100644 --- a/lib/remote/apiclient-heartbeat.cpp +++ b/lib/remote/apiclient-heartbeat.cpp @@ -22,6 +22,7 @@ #include "remote/apifunction.hpp" #include "base/initialize.hpp" #include "base/dynamictype.hpp" +#include "base/logger.hpp" #include using namespace icinga; @@ -45,6 +46,10 @@ void ApiClient::HeartbeatTimerHandler(void) BOOST_FOREACH(const Endpoint::Ptr& endpoint, DynamicType::GetObjectsByType()) { 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; } -- 2.40.0