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

Method EnableServicegroupPassiveSvcChecks

lib/icinga/externalcommandprocessor.cpp:871–884  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

869}
870
871void ExternalCommandProcessor::EnableServicegroupPassiveSvcChecks(double, const std::vector<String>& arguments)
872{
873 ServiceGroup::Ptr sg = ServiceGroup::GetByName(arguments[0]);
874
875 if (!sg)
876 BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot enable servicegroup passive service checks for non-existent servicegroup '" + arguments[0] + "'"));
877
878 for (const Service::Ptr& service : sg->GetMembers()) {
879 Log(LogNotice, "ExternalCommandProcessor")
880 << "Enabling passive checks for service '" << service->GetName() << "'";
881
882 service->ModifyAttribute("enable_passive_checks", true);
883 }
884}
885
886void ExternalCommandProcessor::DisableServicegroupPassiveSvcChecks(double, const std::vector<String>& arguments)
887{

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