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

Method EnableHostgroupHostChecks

lib/icinga/externalcommandprocessor.cpp:1639–1652  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1637}
1638
1639void ExternalCommandProcessor::EnableHostgroupHostChecks(double, const std::vector<String>& arguments)
1640{
1641 HostGroup::Ptr hg = HostGroup::GetByName(arguments[0]);
1642
1643 if (!hg)
1644 BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot enable hostgroup host checks for non-existent hostgroup '" + arguments[0] + "'"));
1645
1646 for (const Host::Ptr& host : hg->GetMembers()) {
1647 Log(LogNotice, "ExternalCommandProcessor")
1648 << "Enabling active checks for host '" << host->GetName() << "'";
1649
1650 host->ModifyAttribute("enable_active_checks", true);
1651 }
1652}
1653
1654void ExternalCommandProcessor::EnableHostgroupPassiveHostChecks(double, const std::vector<String>& arguments)
1655{

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