| 2083 | } |
| 2084 | |
| 2085 | void ExternalCommandProcessor::ChangeSvcCheckTimeperiod(double, const std::vector<String>& arguments) |
| 2086 | { |
| 2087 | Service::Ptr service = Service::GetByNamePair(arguments[0], arguments[1]); |
| 2088 | |
| 2089 | if (!service) |
| 2090 | BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot change check period for non-existent service '" + arguments[1] + "' on host '" + arguments[0] + "'")); |
| 2091 | |
| 2092 | TimePeriod::Ptr tp = TimePeriod::GetByName(arguments[2]); |
| 2093 | |
| 2094 | if (!tp) |
| 2095 | BOOST_THROW_EXCEPTION(std::invalid_argument("Time period '" + arguments[2] + "' does not exist.")); |
| 2096 | |
| 2097 | Log(LogNotice, "ExternalCommandProcessor") |
| 2098 | << "Changing check period for service '" << arguments[1] << "' to '" << arguments[2] << "'"; |
| 2099 | |
| 2100 | service->ModifyAttribute("check_period", tp->GetName()); |
| 2101 | } |
| 2102 | |
| 2103 | void ExternalCommandProcessor::ChangeCustomHostVar(double, const std::vector<String>& arguments) |
| 2104 | { |
nothing calls this directly
no test coverage detected