From: Gunnar Beutner Date: Wed, 10 Dec 2014 08:56:32 +0000 (+0100) Subject: Add log message for heartbeat timeouts X-Git-Tag: v2.3.0~538 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c70623ec7cdb5381256a181d5986b8cbc0ebcf05;p=icinga2 Add log message for heartbeat timeouts refs #7745 --- 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; }