MCPcopy Create free account
hub / github.com/Icinga/icinga2 / EnableHostSvcNotifications

Method EnableHostSvcNotifications

lib/icinga/externalcommandprocessor.cpp:1539–1555  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1537}
1538
1539void 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
1557void ExternalCommandProcessor::DisableHostSvcNotifications(double, const std::vector<String>& arguments)
1558{

Callers

nothing calls this directly

Calls 4

LogClass · 0.85
ModifyAttributeMethod · 0.80
GetServicesMethod · 0.45
GetNameMethod · 0.45

Tested by

no test coverage detected