| 2194 | } |
| 2195 | |
| 2196 | void ExternalCommandProcessor::EnableHostgroupSvcNotifications(double, const std::vector<String>& arguments) |
| 2197 | { |
| 2198 | HostGroup::Ptr hg = HostGroup::GetByName(arguments[0]); |
| 2199 | |
| 2200 | if (!hg) |
| 2201 | BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot enable service notifications for non-existent hostgroup '" + arguments[0] + "'")); |
| 2202 | |
| 2203 | for (const Host::Ptr& host : hg->GetMembers()) { |
| 2204 | for (const Service::Ptr& service : host->GetServices()) { |
| 2205 | Log(LogNotice, "ExternalCommandProcessor") |
| 2206 | << "Enabling notifications for service '" << service->GetName() << "'"; |
| 2207 | |
| 2208 | service->ModifyAttribute("enable_notifications", true); |
| 2209 | } |
| 2210 | } |
| 2211 | } |
| 2212 | |
| 2213 | void ExternalCommandProcessor::DisableHostgroupHostNotifications(double, const std::vector<String>& arguments) |
| 2214 | { |
nothing calls this directly
no test coverage detected