Checker: Fix exception on disabled host checks.

Fixes #6103
This commit is contained in:
Michael Friedrich 2014-05-01 21:57:58 +02:00
parent adc684289a
commit e295d76483
1 changed files with 2 additions and 2 deletions

View File

@ -147,11 +147,11 @@ void CheckerComponent::CheckThreadProc(void)
Service::Ptr service; Service::Ptr service;
tie(host, service) = GetHostService(checkable); tie(host, service) = GetHostService(checkable);
if (!checkable->GetEnableActiveChecks() || (host && !service && !IcingaApplication::GetInstance()->GetEnableHostChecks())) { if (host && !service && (!checkable->GetEnableActiveChecks() || !IcingaApplication::GetInstance()->GetEnableHostChecks())) {
Log(LogDebug, "checker", "Skipping check for host '" + host->GetName() + "': active host checks are disabled"); Log(LogDebug, "checker", "Skipping check for host '" + host->GetName() + "': active host checks are disabled");
check = false; check = false;
} }
if (!checkable->GetEnableActiveChecks() || (host && service && !IcingaApplication::GetInstance()->GetEnableServiceChecks())) { if (host && service && (!checkable->GetEnableActiveChecks() || !IcingaApplication::GetInstance()->GetEnableServiceChecks())) {
Log(LogDebug, "checker", "Skipping check for service '" + service->GetName() + "': active service checks are disabled"); Log(LogDebug, "checker", "Skipping check for service '" + service->GetName() + "': active service checks are disabled");
check = false; check = false;
} }