| 2017 | } |
| 2018 | |
| 2019 | void ExternalCommandProcessor::ChangeSvcCheckCommand(double, const std::vector<String>& arguments) |
| 2020 | { |
| 2021 | Service::Ptr service = Service::GetByNamePair(arguments[0], arguments[1]); |
| 2022 | |
| 2023 | if (!service) |
| 2024 | BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot change check command for non-existent service '" + arguments[1] + "' on host '" + arguments[0] + "'")); |
| 2025 | |
| 2026 | CheckCommand::Ptr command = CheckCommand::GetByName(arguments[2]); |
| 2027 | |
| 2028 | if (!command) |
| 2029 | BOOST_THROW_EXCEPTION(std::invalid_argument("Check command '" + arguments[2] + "' does not exist.")); |
| 2030 | |
| 2031 | Log(LogNotice, "ExternalCommandProcessor") |
| 2032 | << "Changing check command for service '" << arguments[1] << "' to '" << arguments[2] << "'"; |
| 2033 | |
| 2034 | service->ModifyAttribute("check_command", command->GetName()); |
| 2035 | } |
| 2036 | |
| 2037 | void ExternalCommandProcessor::ChangeMaxHostCheckAttempts(double, const std::vector<String>& arguments) |
| 2038 | { |
nothing calls this directly
no test coverage detected