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

Method EnableServicegroupSvcChecks

lib/icinga/externalcommandprocessor.cpp:789–802  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

787}
788
789void ExternalCommandProcessor::EnableServicegroupSvcChecks(double, const std::vector<String>& arguments)
790{
791 ServiceGroup::Ptr sg = ServiceGroup::GetByName(arguments[0]);
792
793 if (!sg)
794 BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot enable servicegroup service checks for non-existent servicegroup '" + arguments[0] + "'"));
795
796 for (const Service::Ptr& service : sg->GetMembers()) {
797 Log(LogNotice, "ExternalCommandProcessor")
798 << "Enabling active checks for service '" << service->GetName() << "'";
799
800 service->ModifyAttribute("enable_active_checks", true);
801 }
802}
803
804void ExternalCommandProcessor::DisableServicegroupSvcChecks(double, const std::vector<String>& arguments)
805{

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