mirror of
https://github.com/Icinga/icinga2.git
synced 2025-09-24 10:17:59 +02:00
WIP
This commit is contained in:
parent
6535f064fe
commit
60b665c1fc
@ -856,13 +856,21 @@ void ApiListener::ApiTimerHandler()
|
||||
}
|
||||
|
||||
for (const Endpoint::Ptr& endpoint : ConfigType::GetObjectsByType<Endpoint>()) {
|
||||
if (!endpoint->GetConnected())
|
||||
Log(LogCritical, "LOG-POSITION")
|
||||
<< "Checking endpoint '" << endpoint->GetName() << "'";
|
||||
if (!endpoint->GetConnected()) {
|
||||
Log(LogCritical, "LOG-POSITION")
|
||||
<< "Endpoint '" << endpoint->GetName() << "' is not connected";
|
||||
continue;
|
||||
}
|
||||
|
||||
double ts = endpoint->GetRemoteLogPosition();
|
||||
|
||||
if (ts == 0)
|
||||
if (ts == 0) {
|
||||
Log(LogCritical, "LOG-POSITION")
|
||||
<< "LocalLogPosition is 0 for endpoint '" << endpoint->GetName() << "'";
|
||||
continue;
|
||||
}
|
||||
|
||||
Dictionary::Ptr lmessage = new Dictionary({
|
||||
{ "jsonrpc", "2.0" },
|
||||
|
@ -265,6 +265,8 @@ void JsonRpcConnection::MessageHandler(const String& jsonString)
|
||||
if (ts < m_Endpoint->GetRemoteLogPosition())
|
||||
return;
|
||||
|
||||
Log(LogCritical, "LOG-POSITION")
|
||||
<< "SetRemoteLogPosition to '" << ts << "' for endpoint '" << m_Endpoint->GetName() << "'";
|
||||
m_Endpoint->SetRemoteLogPosition(ts);
|
||||
}
|
||||
|
||||
@ -342,7 +344,7 @@ Value SetLogPositionHandler(const MessageOrigin::Ptr& origin, const Dictionary::
|
||||
endpoint->SetLocalLogPosition(log_position);
|
||||
|
||||
Log(LogCritical, "LOG-POSITION")
|
||||
<< "Got SetLogPosition with timestamp '" << log_position << "' from endpoint '" << endpoint->GetName() << "'";
|
||||
<< "Got SetLocalLogPosition with timestamp '" << log_position << "' from endpoint '" << endpoint->GetName() << "'";
|
||||
|
||||
return Empty;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user