mirror of
https://github.com/Icinga/icinga2.git
synced 2025-04-08 17:05:25 +02:00
Clean up reachability calculation.
This commit is contained in:
parent
16e8d131fb
commit
9e7ba72eb4
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user