From 9e7ba72eb46242a0e17fcc212b477ea274782e7d Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Mon, 9 Jul 2012 17:03:24 +0200 Subject: [PATCH] Clean up reachability calculation. --- cib/service.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) 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; }