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

Method DisableServicegroupSvcChecks

lib/icinga/externalcommandprocessor.cpp:804–817  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

802}
803
804void ExternalCommandProcessor::DisableServicegroupSvcChecks(double, const std::vector<String>& arguments)
805{
806 ServiceGroup::Ptr sg = ServiceGroup::GetByName(arguments[0]);
807
808 if (!sg)
809 BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot disable servicegroup service checks for non-existent servicegroup '" + arguments[0] + "'"));
810
811 for (const Service::Ptr& service : sg->GetMembers()) {
812 Log(LogNotice, "ExternalCommandProcessor")
813 << "Disabling active checks for service '" << service->GetName() << "'";
814
815 service->ModifyAttribute("enable_active_checks", false);
816 }
817}
818
819void ExternalCommandProcessor::EnablePassiveHostChecks(double, const std::vector<String>& arguments)
820{

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