Add log message for heartbeat timeouts

refs #7745
This commit is contained in:
Gunnar Beutner 2014-12-10 09:56:32 +01:00
parent 89a0fc006e
commit c70623ec7c
1 changed files with 5 additions and 0 deletions

View 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;
}