| 606 | } |
| 607 | |
| 608 | void ExternalCommandProcessor::AcknowledgeSvcProblem(double, const std::vector<String>& arguments) |
| 609 | { |
| 610 | bool sticky = (Convert::ToLong(arguments[2]) == 2 ? true : false); |
| 611 | bool notify = (Convert::ToLong(arguments[3]) > 0 ? true : false); |
| 612 | bool persistent = (Convert::ToLong(arguments[4]) > 0 ? true : false); |
| 613 | |
| 614 | Service::Ptr service = Service::GetByNamePair(arguments[0], arguments[1]); |
| 615 | ObjectLock oLock (service); |
| 616 | |
| 617 | if (!service) |
| 618 | BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot acknowledge service problem for non-existent service '" + arguments[1] + "' on host '" + arguments[0] + "'")); |
| 619 | |
| 620 | if (service->GetState() == ServiceOK) |
| 621 | BOOST_THROW_EXCEPTION(std::invalid_argument("The service '" + arguments[1] + "' is OK.")); |
| 622 | |
| 623 | if (service->IsAcknowledged()) { |
| 624 | BOOST_THROW_EXCEPTION(std::invalid_argument("The service '" + arguments[1] + "' is already acknowledged.")); |
| 625 | } |
| 626 | |
| 627 | Log(LogNotice, "ExternalCommandProcessor") |
| 628 | << "Setting acknowledgement for service '" << service->GetName() << "'" << (notify ? "" : ". Disabled notification"); |
| 629 | |
| 630 | Comment::AddComment(service, CommentAcknowledgement, arguments[5], arguments[6], persistent, 0, sticky); |
| 631 | service->AcknowledgeProblem(arguments[5], arguments[6], sticky ? AcknowledgementSticky : AcknowledgementNormal, notify, persistent); |
| 632 | } |
| 633 | |
| 634 | void ExternalCommandProcessor::AcknowledgeSvcProblemExpire(double, const std::vector<String>& arguments) |
| 635 | { |
nothing calls this directly
no test coverage detected