]> granicus.if.org Git - icinga2/commitdiff
Fix lag calculation for the 'cluster-zone' check
authorGunnar Beutner <gunnar@beutner.name>
Tue, 3 Mar 2015 13:40:05 +0000 (14:40 +0100)
committerGunnar Beutner <gunnar@beutner.name>
Tue, 3 Mar 2015 13:42:22 +0000 (14:42 +0100)
lib/methods/clusterzonechecktask.cpp

index f1a3eb9c68690f2f39691fdd2831cdbef278b0c8..8cd788ad1595f97230cb6654119df41c2b6ead28 100644 (file)
@@ -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) {