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

Method EnableHostgroupPassiveHostChecks

lib/icinga/externalcommandprocessor.cpp:1654–1667  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1652}
1653
1654void ExternalCommandProcessor::EnableHostgroupPassiveHostChecks(double, const std::vector<String>& arguments)
1655{
1656 HostGroup::Ptr hg = HostGroup::GetByName(arguments[0]);
1657
1658 if (!hg)
1659 BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot enable hostgroup passive host checks for non-existent hostgroup '" + arguments[0] + "'"));
1660
1661 for (const Host::Ptr& host : hg->GetMembers()) {
1662 Log(LogNotice, "ExternalCommandProcessor")
1663 << "Enabling passive checks for host '" << host->GetName() << "'";
1664
1665 host->ModifyAttribute("enable_passive_checks", true);
1666 }
1667}
1668
1669void ExternalCommandProcessor::EnableServicegroupHostChecks(double, const std::vector<String>& arguments)
1670{

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