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

Method DisableServicegroupSvcNotifications

lib/icinga/externalcommandprocessor.cpp:2294–2307  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2292}
2293
2294void ExternalCommandProcessor::DisableServicegroupSvcNotifications(double, const std::vector<String>& arguments)
2295{
2296 ServiceGroup::Ptr sg = ServiceGroup::GetByName(arguments[0]);
2297
2298 if (!sg)
2299 BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot disable service notifications for non-existent servicegroup '" + arguments[0] + "'"));
2300
2301 for (const Service::Ptr& service : sg->GetMembers()) {
2302 Log(LogNotice, "ExternalCommandProcessor")
2303 << "Disabling notifications for service '" << service->GetName() << "'";
2304
2305 service->ModifyAttribute("enable_notifications", false);
2306 }
2307}
2308
2309std::mutex& ExternalCommandProcessor::GetMutex()
2310{

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