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

Method ChangeMaxSvcCheckAttempts

lib/icinga/externalcommandprocessor.cpp:2052–2065  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2050}
2051
2052void ExternalCommandProcessor::ChangeMaxSvcCheckAttempts(double, const std::vector<String>& arguments)
2053{
2054 Service::Ptr service = Service::GetByNamePair(arguments[0], arguments[1]);
2055
2056 if (!service)
2057 BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot change max check attempts for non-existent service '" + arguments[1] + "' on host '" + arguments[0] + "'"));
2058
2059 int attempts = Convert::ToLong(arguments[2]);
2060
2061 Log(LogNotice, "ExternalCommandProcessor")
2062 << "Changing max check attempts for service '" << arguments[1] << "' to '" << arguments[2] << "'";
2063
2064 service->ModifyAttribute("max_check_attempts", attempts);
2065}
2066
2067void ExternalCommandProcessor::ChangeHostCheckTimeperiod(double, const std::vector<String>& arguments)
2068{

Callers

nothing calls this directly

Calls 2

LogClass · 0.85
ModifyAttributeMethod · 0.80

Tested by

no test coverage detected