mirror of https://github.com/Icinga/icinga2.git
parent
89a0fc006e
commit
c70623ec7c
|
@ -22,6 +22,7 @@
|
||||||
#include "remote/apifunction.hpp"
|
#include "remote/apifunction.hpp"
|
||||||
#include "base/initialize.hpp"
|
#include "base/initialize.hpp"
|
||||||
#include "base/dynamictype.hpp"
|
#include "base/dynamictype.hpp"
|
||||||
|
#include "base/logger.hpp"
|
||||||
#include <boost/foreach.hpp>
|
#include <boost/foreach.hpp>
|
||||||
|
|
||||||
using namespace icinga;
|
using namespace icinga;
|
||||||
|
@ -45,6 +46,10 @@ void ApiClient::HeartbeatTimerHandler(void)
|
||||||
BOOST_FOREACH(const Endpoint::Ptr& endpoint, DynamicType::GetObjectsByType<Endpoint>()) {
|
BOOST_FOREACH(const Endpoint::Ptr& endpoint, DynamicType::GetObjectsByType<Endpoint>()) {
|
||||||
BOOST_FOREACH(const ApiClient::Ptr& client, endpoint->GetClients()) {
|
BOOST_FOREACH(const ApiClient::Ptr& client, endpoint->GetClients()) {
|
||||||
if (client->m_NextHeartbeat != 0 && client->m_NextHeartbeat < Utility::GetTime()) {
|
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();
|
client->Disconnect();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue