]> granicus.if.org Git - icinga2/commitdiff
Clean up reachability calculation.
authorGunnar Beutner <gunnar.beutner@netways.de>
Mon, 9 Jul 2012 15:03:24 +0000 (17:03 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Mon, 9 Jul 2012 15:03:24 +0000 (17:03 +0200)
cib/service.cpp

index 8fcc28dd56744826ce70b0640b5ae8e789a07c7f..7d7d398c3832931653b6075f474ba65ea81aba92 100644 (file)
@@ -144,11 +144,18 @@ bool Service::IsReachable(void) const
                if (!service.HasLastCheckResult())
                        continue;
 
-               if (service.GetStateType() == StateTypeHard && service.GetState() != StateOK &&
-                   service.GetState() != StateWarning)
-                       return false;
+               /* ignore soft states */
+               if (service.GetStateType() == StateTypeSoft)
+                       continue;
+
+               /* ignore services states OK and Warning */
+               if (service.GetState() == StateOK ||
+                   service.GetState() == StateWarning)
+                       continue;
+
+               return false;
        }
-       
+
        return true;
 }