mirror of https://github.com/Icinga/icinga2.git
Finish implementing ExternalCommand::EnableHostgroupSvcChecks and ExternalCommand::DisableHostgroupSvcChecks
Fixes #3566
This commit is contained in:
parent
b3e7dc32e9
commit
bbbdb41581
|
@ -329,7 +329,10 @@ void ExternalCommand::EnableHostgroupSvcChecks(double time, const vector<String>
|
||||||
HostGroup::Ptr hg = HostGroup::GetByName(arguments[0]);
|
HostGroup::Ptr hg = HostGroup::GetByName(arguments[0]);
|
||||||
|
|
||||||
BOOST_FOREACH(const Host::Ptr& host, hg->GetMembers()) {
|
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 vector<String
|
||||||
HostGroup::Ptr hg = HostGroup::GetByName(arguments[0]);
|
HostGroup::Ptr hg = HostGroup::GetByName(arguments[0]);
|
||||||
|
|
||||||
BOOST_FOREACH(const Host::Ptr& host, hg->GetMembers()) {
|
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", "Disabling checks for service '" + service->GetName() + "'");
|
||||||
|
service->SetEnableChecks(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue