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

Method EnableServicegroupSvcNotifications

lib/icinga/externalcommandprocessor.cpp:2262–2275  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2260}
2261
2262void ExternalCommandProcessor::EnableServicegroupSvcNotifications(double, const std::vector<String>& arguments)
2263{
2264 ServiceGroup::Ptr sg = ServiceGroup::GetByName(arguments[0]);
2265
2266 if (!sg)
2267 BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot enable service notifications for non-existent servicegroup '" + arguments[0] + "'"));
2268
2269 for (const Service::Ptr& service : sg->GetMembers()) {
2270 Log(LogNotice, "ExternalCommandProcessor")
2271 << "Enabling notifications for service '" << service->GetName() << "'";
2272
2273 service->ModifyAttribute("enable_notifications", true);
2274 }
2275}
2276
2277void ExternalCommandProcessor::DisableServicegroupHostNotifications(double, const std::vector<String>& arguments)
2278{

Callers

nothing calls this directly

Calls 4

LogClass · 0.85
ModifyAttributeMethod · 0.80
GetMembersMethod · 0.45
GetNameMethod · 0.45

Tested by

no test coverage detected