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

Method EnableServicegroupHostChecks

lib/icinga/externalcommandprocessor.cpp:1669–1684  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1667}
1668
1669void ExternalCommandProcessor::EnableServicegroupHostChecks(double, const std::vector<String>& arguments)
1670{
1671 ServiceGroup::Ptr sg = ServiceGroup::GetByName(arguments[0]);
1672
1673 if (!sg)
1674 BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot enable servicegroup host checks for non-existent servicegroup '" + arguments[0] + "'"));
1675
1676 for (const Service::Ptr& service : sg->GetMembers()) {
1677 Host::Ptr host = service->GetHost();
1678
1679 Log(LogNotice, "ExternalCommandProcessor")
1680 << "Enabling active checks for host '" << host->GetName() << "'";
1681
1682 host->ModifyAttribute("enable_active_checks", true);
1683 }
1684}
1685
1686void ExternalCommandProcessor::EnableServicegroupPassiveHostChecks(double, const std::vector<String>& arguments)
1687{

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