| 2243 | } |
| 2244 | |
| 2245 | void ExternalCommandProcessor::EnableServicegroupHostNotifications(double, const std::vector<String>& arguments) |
| 2246 | { |
| 2247 | ServiceGroup::Ptr sg = ServiceGroup::GetByName(arguments[0]); |
| 2248 | |
| 2249 | if (!sg) |
| 2250 | BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot enable host notifications for non-existent servicegroup '" + arguments[0] + "'")); |
| 2251 | |
| 2252 | for (const Service::Ptr& service : sg->GetMembers()) { |
| 2253 | Host::Ptr host = service->GetHost(); |
| 2254 | |
| 2255 | Log(LogNotice, "ExternalCommandProcessor") |
| 2256 | << "Enabling notifications for host '" << host->GetName() << "'"; |
| 2257 | |
| 2258 | host->ModifyAttribute("enable_notifications", true); |
| 2259 | } |
| 2260 | } |
| 2261 | |
| 2262 | void ExternalCommandProcessor::EnableServicegroupSvcNotifications(double, const std::vector<String>& arguments) |
| 2263 | { |
nothing calls this directly
no test coverage detected