]> granicus.if.org Git - icinga2/commitdiff
Invert connected check
authorChristopher Schirner <schinken@bamberg.ccc.de>
Tue, 31 Jul 2018 08:40:54 +0000 (10:40 +0200)
committerMichael Friedrich <michael.friedrich@icinga.com>
Wed, 1 Aug 2018 09:01:40 +0000 (11:01 +0200)
refs #6505

lib/methods/clusterzonechecktask.cpp

index 76a6fb2b294c9a44dec088d0af17bfa91bff4845..b5a317f8b69b6d737851029d3bc9dcd2c7fb2560 100644 (file)
@@ -122,12 +122,12 @@ void ClusterZoneCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const Che
                bytesReceivedPerSecond += endpoint->GetBytesReceivedPerSecond();
        }
 
-       if (!connected) {
-               cr->SetState(ServiceCritical);
-               cr->SetOutput("Zone '" + zoneName + "' is not connected. Log lag: " + Utility::FormatDuration(zoneLag));
-       } else {
+       if (connected) {
                cr->SetState(ServiceOK);
                cr->SetOutput("Zone '" + zoneName + "' is connected. Log lag: " + Utility::FormatDuration(zoneLag));
+       } else {
+               cr->SetState(ServiceCritical);
+               cr->SetOutput("Zone '" + zoneName + "' is not connected. Log lag: " + Utility::FormatDuration(zoneLag));
        }
 
        /* Check whether the thresholds have been resolved and compare them */