| 2065 | } |
| 2066 | |
| 2067 | void ExternalCommandProcessor::ChangeHostCheckTimeperiod(double, const std::vector<String>& arguments) |
| 2068 | { |
| 2069 | Host::Ptr host = Host::GetByName(arguments[0]); |
| 2070 | |
| 2071 | if (!host) |
| 2072 | BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot change check period for non-existent host '" + arguments[0] + "'")); |
| 2073 | |
| 2074 | TimePeriod::Ptr tp = TimePeriod::GetByName(arguments[1]); |
| 2075 | |
| 2076 | if (!tp) |
| 2077 | BOOST_THROW_EXCEPTION(std::invalid_argument("Time period '" + arguments[1] + "' does not exist.")); |
| 2078 | |
| 2079 | Log(LogNotice, "ExternalCommandProcessor") |
| 2080 | << "Changing check period for host '" << arguments[0] << "' to '" << arguments[1] << "'"; |
| 2081 | |
| 2082 | host->ModifyAttribute("check_period", tp->GetName()); |
| 2083 | } |
| 2084 | |
| 2085 | void ExternalCommandProcessor::ChangeSvcCheckTimeperiod(double, const std::vector<String>& arguments) |
| 2086 | { |
nothing calls this directly
no test coverage detected