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

Method EnableHostFlapping

lib/icinga/externalcommandprocessor.cpp:1703–1714  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1701}
1702
1703void ExternalCommandProcessor::EnableHostFlapping(double, const std::vector<String>& arguments)
1704{
1705 Host::Ptr host = Host::GetByName(arguments[0]);
1706
1707 if (!host)
1708 BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot enable host flapping for non-existent host '" + arguments[0] + "'"));
1709
1710 Log(LogNotice, "ExternalCommandProcessor")
1711 << "Enabling flapping detection for host '" << arguments[0] << "'";
1712
1713 host->ModifyAttribute("enable_flapping", true);
1714}
1715
1716void ExternalCommandProcessor::DisableHostFlapping(double, const std::vector<String>& arguments)
1717{

Callers

nothing calls this directly

Calls 2

LogClass · 0.85
ModifyAttributeMethod · 0.80

Tested by

no test coverage detected