| 1367 | } |
| 1368 | |
| 1369 | void ExternalCommandProcessor::AddSvcComment(double, const std::vector<String>& arguments) |
| 1370 | { |
| 1371 | Service::Ptr service = Service::GetByNamePair(arguments[0], arguments[1]); |
| 1372 | |
| 1373 | if (!service) |
| 1374 | BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot add service comment for non-existent service '" + arguments[1] + "' on host '" + arguments[0] + "'")); |
| 1375 | |
| 1376 | if (arguments[3].IsEmpty() || arguments[4].IsEmpty()) |
| 1377 | BOOST_THROW_EXCEPTION(std::invalid_argument("Author and comment must not be empty")); |
| 1378 | |
| 1379 | Log(LogNotice, "ExternalCommandProcessor") |
| 1380 | << "Creating comment for service " << service->GetName(); |
| 1381 | (void) Comment::AddComment(service, CommentUser, arguments[3], arguments[4], false, 0); |
| 1382 | } |
| 1383 | |
| 1384 | void ExternalCommandProcessor::DelSvcComment(double, const std::vector<String>& arguments) |
| 1385 | { |