| 2226 | } |
| 2227 | |
| 2228 | void ExternalCommandProcessor::DisableHostgroupSvcNotifications(double, const std::vector<String>& arguments) |
| 2229 | { |
| 2230 | HostGroup::Ptr hg = HostGroup::GetByName(arguments[0]); |
| 2231 | |
| 2232 | if (!hg) |
| 2233 | BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot disable service notifications for non-existent hostgroup '" + arguments[0] + "'")); |
| 2234 | |
| 2235 | for (const Host::Ptr& host : hg->GetMembers()) { |
| 2236 | for (const Service::Ptr& service : host->GetServices()) { |
| 2237 | Log(LogNotice, "ExternalCommandProcessor") |
| 2238 | << "Disabling notifications for service '" << service->GetName() << "'"; |
| 2239 | |
| 2240 | service->ModifyAttribute("enable_notifications", false); |
| 2241 | } |
| 2242 | } |
| 2243 | } |
| 2244 | |
| 2245 | void ExternalCommandProcessor::EnableServicegroupHostNotifications(double, const std::vector<String>& arguments) |
| 2246 | { |
nothing calls this directly
no test coverage detected