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

Method ChangeMaxHostCheckAttempts

lib/icinga/externalcommandprocessor.cpp:2037–2050  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2035}
2036
2037void ExternalCommandProcessor::ChangeMaxHostCheckAttempts(double, const std::vector<String>& arguments)
2038{
2039 Host::Ptr host = Host::GetByName(arguments[0]);
2040
2041 if (!host)
2042 BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot change max check attempts for non-existent host '" + arguments[0] + "'"));
2043
2044 int attempts = Convert::ToLong(arguments[1]);
2045
2046 Log(LogNotice, "ExternalCommandProcessor")
2047 << "Changing max check attempts for host '" << arguments[0] << "' to '" << arguments[1] << "'";
2048
2049 host->ModifyAttribute("max_check_attempts", attempts);
2050}
2051
2052void ExternalCommandProcessor::ChangeMaxSvcCheckAttempts(double, const std::vector<String>& arguments)
2053{

Callers

nothing calls this directly

Calls 2

LogClass · 0.85
ModifyAttributeMethod · 0.80

Tested by

no test coverage detected