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

Method DisableHostSvcNotifications

lib/icinga/externalcommandprocessor.cpp:1557–1573  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1555}
1556
1557void ExternalCommandProcessor::DisableHostSvcNotifications(double, const std::vector<String>& arguments)
1558{
1559 Host::Ptr host = Host::GetByName(arguments[0]);
1560
1561 if (!host)
1562 BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot disable notifications for all services for non-existent host '" + arguments[0] + "'"));
1563
1564 Log(LogNotice, "ExternalCommandProcessor")
1565 << "Disabling notifications for all services on host '" << arguments[0] << "'";
1566
1567 for (const Service::Ptr& service : host->GetServices()) {
1568 Log(LogNotice, "ExternalCommandProcessor")
1569 << "Disabling notifications for service '" << service->GetName() << "'";
1570
1571 service->ModifyAttribute("enable_notifications", false);
1572 }
1573}
1574
1575void ExternalCommandProcessor::DisableHostgroupHostChecks(double, const std::vector<String>& arguments)
1576{

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