From bbbdb4158182aa6f02b3074c2fed8eeebce38ce5 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Thu, 24 Jan 2013 15:12:32 +0100 Subject: [PATCH] Finish implementing ExternalCommand::EnableHostgroupSvcChecks and ExternalCommand::DisableHostgroupSvcChecks Fixes #3566 --- lib/icinga/externalcommand.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/icinga/externalcommand.cpp b/lib/icinga/externalcommand.cpp index 491260b29..6b0a7e1b4 100644 --- a/lib/icinga/externalcommand.cpp +++ b/lib/icinga/externalcommand.cpp @@ -329,7 +329,10 @@ void ExternalCommand::EnableHostgroupSvcChecks(double time, const vector HostGroup::Ptr hg = HostGroup::GetByName(arguments[0]); BOOST_FOREACH(const Host::Ptr& host, hg->GetMembers()) { - // TODO: finish implementing this (#3566) + BOOST_FOREACH(const Service::Ptr& service, host->GetServices()) { + Logger::Write(LogInformation, "icinga", "Enabling checks for service '" + service->GetName() + "'"); + service->SetEnableChecks(true); + } } } @@ -344,7 +347,10 @@ void ExternalCommand::DisableHostgroupSvcChecks(double time, const vectorGetMembers()) { - // TODO: finish implementing this (#3566) + BOOST_FOREACH(const Service::Ptr& service, host->GetServices()) { + Logger::Write(LogInformation, "icinga", "Disabling checks for service '" + service->GetName() + "'"); + service->SetEnableChecks(false); + } } }