| 899 | } |
| 900 | |
| 901 | void ExternalCommandProcessor::EnableHostgroupPassiveSvcChecks(double, const std::vector<String>& arguments) |
| 902 | { |
| 903 | HostGroup::Ptr hg = HostGroup::GetByName(arguments[0]); |
| 904 | |
| 905 | if (!hg) |
| 906 | BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot enable hostgroup passive service checks for non-existent hostgroup '" + arguments[0] + "'")); |
| 907 | |
| 908 | for (const Host::Ptr& host : hg->GetMembers()) { |
| 909 | for (const Service::Ptr& service : host->GetServices()) { |
| 910 | Log(LogNotice, "ExternalCommandProcessor") |
| 911 | << "Enabling passive checks for service '" << service->GetName() << "'"; |
| 912 | |
| 913 | service->ModifyAttribute("enable_passive_checks", true); |
| 914 | } |
| 915 | } |
| 916 | } |
| 917 | |
| 918 | void ExternalCommandProcessor::DisableHostgroupPassiveSvcChecks(double, const std::vector<String>& arguments) |
| 919 | { |
nothing calls this directly
no test coverage detected