| 1999 | } |
| 2000 | |
| 2001 | void ExternalCommandProcessor::ChangeHostCheckCommand(double, const std::vector<String>& arguments) |
| 2002 | { |
| 2003 | Host::Ptr host = Host::GetByName(arguments[0]); |
| 2004 | |
| 2005 | if (!host) |
| 2006 | BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot change check command for non-existent host '" + arguments[0] + "'")); |
| 2007 | |
| 2008 | CheckCommand::Ptr command = CheckCommand::GetByName(arguments[1]); |
| 2009 | |
| 2010 | if (!command) |
| 2011 | BOOST_THROW_EXCEPTION(std::invalid_argument("Check command '" + arguments[1] + "' does not exist.")); |
| 2012 | |
| 2013 | Log(LogNotice, "ExternalCommandProcessor") |
| 2014 | << "Changing check command for host '" << arguments[0] << "' to '" << arguments[1] << "'"; |
| 2015 | |
| 2016 | host->ModifyAttribute("check_command", command->GetName()); |
| 2017 | } |
| 2018 | |
| 2019 | void ExternalCommandProcessor::ChangeSvcCheckCommand(double, const std::vector<String>& arguments) |
| 2020 | { |
nothing calls this directly
no test coverage detected