From: Gunnar Beutner Date: Tue, 3 Mar 2015 13:40:05 +0000 (+0100) Subject: Fix lag calculation for the 'cluster-zone' check X-Git-Tag: v2.3.0~39 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c9c7f9bed10cb4b9a9feb291f3153492a9c30105;p=icinga2 Fix lag calculation for the 'cluster-zone' check --- diff --git a/lib/methods/clusterzonechecktask.cpp b/lib/methods/clusterzonechecktask.cpp index f1a3eb9c6..8cd788ad1 100644 --- a/lib/methods/clusterzonechecktask.cpp +++ b/lib/methods/clusterzonechecktask.cpp @@ -86,13 +86,11 @@ void ClusterZoneCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const Che BOOST_FOREACH(const Endpoint::Ptr& endpoint, zone->GetEndpoints()) { double eplag = Utility::GetTime() - endpoint->GetRemoteLogPosition(); - if (eplag > lag) - lag = eplag; - - if (endpoint->IsConnected()) { + if (endpoint->IsConnected()) connected = true; - break; - } + + if ((endpoint->GetSyncing() || !endpoint->IsConnected()) && eplag > lag) + lag = eplag; } if (!connected) {