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

Method DisableServicegroupPassiveSvcChecks

lib/icinga/externalcommandprocessor.cpp:886–899  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

884}
885
886void ExternalCommandProcessor::DisableServicegroupPassiveSvcChecks(double, const std::vector<String>& arguments)
887{
888 ServiceGroup::Ptr sg = ServiceGroup::GetByName(arguments[0]);
889
890 if (!sg)
891 BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot disable servicegroup passive service checks for non-existent servicegroup '" + arguments[0] + "'"));
892
893 for (const Service::Ptr& service : sg->GetMembers()) {
894 Log(LogNotice, "ExternalCommandProcessor")
895 << "Disabling passive checks for service '" << service->GetName() << "'";
896
897 service->ModifyAttribute("enable_passive_checks", false);
898 }
899}
900
901void ExternalCommandProcessor::EnableHostgroupPassiveSvcChecks(double, const std::vector<String>& arguments)
902{

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