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

Method DisableServicegroupHostChecks

lib/icinga/externalcommandprocessor.cpp:1605–1620  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1603}
1604
1605void ExternalCommandProcessor::DisableServicegroupHostChecks(double, const std::vector<String>& arguments)
1606{
1607 ServiceGroup::Ptr sg = ServiceGroup::GetByName(arguments[0]);
1608
1609 if (!sg)
1610 BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot disable servicegroup host checks for non-existent servicegroup '" + arguments[0] + "'"));
1611
1612 for (const Service::Ptr& service : sg->GetMembers()) {
1613 Host::Ptr host = service->GetHost();
1614
1615 Log(LogNotice, "ExternalCommandProcessor")
1616 << "Disabling active checks for host '" << host->GetName() << "'";
1617
1618 host->ModifyAttribute("enable_active_checks", false);
1619 }
1620}
1621
1622void ExternalCommandProcessor::DisableServicegroupPassiveHostChecks(double, const std::vector<String>& arguments)
1623{

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected