| 1537 | } |
| 1538 | |
| 1539 | void ExternalCommandProcessor::EnableHostSvcNotifications(double, const std::vector<String>& arguments) |
| 1540 | { |
| 1541 | Host::Ptr host = Host::GetByName(arguments[0]); |
| 1542 | |
| 1543 | if (!host) |
| 1544 | BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot enable notifications for all services for non-existent host '" + arguments[0] + "'")); |
| 1545 | |
| 1546 | Log(LogNotice, "ExternalCommandProcessor") |
| 1547 | << "Enabling notifications for all services on host '" << arguments[0] << "'"; |
| 1548 | |
| 1549 | for (const Service::Ptr& service : host->GetServices()) { |
| 1550 | Log(LogNotice, "ExternalCommandProcessor") |
| 1551 | << "Enabling notifications for service '" << service->GetName() << "'"; |
| 1552 | |
| 1553 | service->ModifyAttribute("enable_notifications", true); |
| 1554 | } |
| 1555 | } |
| 1556 | |
| 1557 | void ExternalCommandProcessor::DisableHostSvcNotifications(double, const std::vector<String>& arguments) |
| 1558 | { |
nothing calls this directly
no test coverage detected