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

Method EnableServicegroupPassiveHostChecks

lib/icinga/externalcommandprocessor.cpp:1686–1701  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1684}
1685
1686void ExternalCommandProcessor::EnableServicegroupPassiveHostChecks(double, const std::vector<String>& arguments)
1687{
1688 ServiceGroup::Ptr sg = ServiceGroup::GetByName(arguments[0]);
1689
1690 if (!sg)
1691 BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot enable servicegroup passive host checks for non-existent servicegroup '" + arguments[0] + "'"));
1692
1693 for (const Service::Ptr& service : sg->GetMembers()) {
1694 Host::Ptr host = service->GetHost();
1695
1696 Log(LogNotice, "ExternalCommandProcessor")
1697 << "Enabling passive checks for host '" << host->GetName() << "'";
1698
1699 host->ModifyAttribute("enable_passive_checks", true);
1700 }
1701}
1702
1703void ExternalCommandProcessor::EnableHostFlapping(double, const std::vector<String>& arguments)
1704{

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