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

Method DisableHostgroupHostChecks

lib/icinga/externalcommandprocessor.cpp:1575–1588  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1573}
1574
1575void ExternalCommandProcessor::DisableHostgroupHostChecks(double, const std::vector<String>& arguments)
1576{
1577 HostGroup::Ptr hg = HostGroup::GetByName(arguments[0]);
1578
1579 if (!hg)
1580 BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot disable hostgroup host checks for non-existent hostgroup '" + arguments[0] + "'"));
1581
1582 for (const Host::Ptr& host : hg->GetMembers()) {
1583 Log(LogNotice, "ExternalCommandProcessor")
1584 << "Disabling active checks for host '" << host->GetName() << "'";
1585
1586 host->ModifyAttribute("enable_active_checks", false);
1587 }
1588}
1589
1590void ExternalCommandProcessor::DisableHostgroupPassiveHostChecks(double, const std::vector<String>& arguments)
1591{

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