| 1343 | } |
| 1344 | |
| 1345 | void ExternalCommandProcessor::AddHostComment(double, const std::vector<String>& arguments) |
| 1346 | { |
| 1347 | Host::Ptr host = Host::GetByName(arguments[0]); |
| 1348 | |
| 1349 | if (!host) |
| 1350 | BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot add host comment for non-existent host '" + arguments[0] + "'")); |
| 1351 | |
| 1352 | if (arguments[2].IsEmpty() || arguments[3].IsEmpty()) |
| 1353 | BOOST_THROW_EXCEPTION(std::invalid_argument("Author and comment must not be empty")); |
| 1354 | |
| 1355 | Log(LogNotice, "ExternalCommandProcessor") |
| 1356 | << "Creating comment for host " << host->GetName(); |
| 1357 | (void) Comment::AddComment(host, CommentUser, arguments[2], arguments[3], false, 0); |
| 1358 | } |
| 1359 | |
| 1360 | void ExternalCommandProcessor::DelHostComment(double, const std::vector<String>& arguments) |
| 1361 | { |