From: Gunnar Beutner Date: Mon, 9 Jul 2012 15:03:24 +0000 (+0200) Subject: Clean up reachability calculation. X-Git-Tag: v0.0.1~281 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9e7ba72eb46242a0e17fcc212b477ea274782e7d;p=icinga2 Clean up reachability calculation. --- diff --git a/cib/service.cpp b/cib/service.cpp index 8fcc28dd5..7d7d398c3 100644 --- a/cib/service.cpp +++ b/cib/service.cpp @@ -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; }