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

Method DisableHostgroupSvcChecks

lib/icinga/externalcommandprocessor.cpp:772–787  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

770}
771
772void ExternalCommandProcessor::DisableHostgroupSvcChecks(double, const std::vector<String>& arguments)
773{
774 HostGroup::Ptr hg = HostGroup::GetByName(arguments[0]);
775
776 if (!hg)
777 BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot disable hostgroup service checks for non-existent hostgroup '" + arguments[0] + "'"));
778
779 for (const Host::Ptr& host : hg->GetMembers()) {
780 for (const Service::Ptr& service : host->GetServices()) {
781 Log(LogNotice, "ExternalCommandProcessor")
782 << "Disabling active checks for service '" << service->GetName() << "'";
783
784 service->ModifyAttribute("enable_active_checks", false);
785 }
786 }
787}
788
789void ExternalCommandProcessor::EnableServicegroupSvcChecks(double, const std::vector<String>& arguments)
790{

Callers

nothing calls this directly

Calls 5

LogClass · 0.85
ModifyAttributeMethod · 0.80
GetMembersMethod · 0.45
GetServicesMethod · 0.45
GetNameMethod · 0.45

Tested by

no test coverage detected