mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-26 07:04:37 +02:00
Fixed reachability calculation for host checks.
This commit is contained in:
parent
a960237139
commit
39b0806778
@ -159,9 +159,20 @@ String Service::GetShortName(void) const
|
|||||||
|
|
||||||
bool Service::IsReachable(const Service::Ptr& self)
|
bool Service::IsReachable(const Service::Ptr& self)
|
||||||
{
|
{
|
||||||
|
String service_name;
|
||||||
|
|
||||||
|
{
|
||||||
|
ObjectLock olock(self);
|
||||||
|
service_name = self->GetName();
|
||||||
|
}
|
||||||
|
|
||||||
BOOST_FOREACH(const Service::Ptr& service, Service::GetParentServices(self)) {
|
BOOST_FOREACH(const Service::Ptr& service, Service::GetParentServices(self)) {
|
||||||
ObjectLock olock(service);
|
ObjectLock olock(service);
|
||||||
|
|
||||||
|
/* ignore ourselves */
|
||||||
|
if (service->GetName() == service_name)
|
||||||
|
continue;
|
||||||
|
|
||||||
/* ignore pending services */
|
/* ignore pending services */
|
||||||
if (!service->GetLastCheckResult())
|
if (!service->GetLastCheckResult())
|
||||||
continue;
|
continue;
|
||||||
@ -182,6 +193,10 @@ bool Service::IsReachable(const Service::Ptr& self)
|
|||||||
Service::Ptr hc = Host::GetHostCheckService(host);
|
Service::Ptr hc = Host::GetHostCheckService(host);
|
||||||
ObjectLock olock(hc);
|
ObjectLock olock(hc);
|
||||||
|
|
||||||
|
/* ignore ourselves */
|
||||||
|
if (hc->GetName() == service_name)
|
||||||
|
continue;
|
||||||
|
|
||||||
/* ignore hosts that are up */
|
/* ignore hosts that are up */
|
||||||
if (hc && hc->GetState() == StateOK)
|
if (hc && hc->GetState() == StateOK)
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user