From 740170d1a79ffe3c9526da62fe99585ff6f1d7bc Mon Sep 17 00:00:00 2001 From: Federico Cuello Date: Fri, 11 Aug 2017 14:39:47 +0200 Subject: [PATCH] Fix parameter order for Acknowledge{,Svc,Host}Problem in API actions/external commands It was preventing email notifications with default settings, as `persistent` defaults to false and therefore `notify` was not set. Signed-off-by: Michael Friedrich refs #5495 --- lib/icinga/apiactions.cpp | 2 +- lib/icinga/externalcommandprocessor.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/icinga/apiactions.cpp b/lib/icinga/apiactions.cpp index d488cd599..da544ddea 100644 --- a/lib/icinga/apiactions.cpp +++ b/lib/icinga/apiactions.cpp @@ -226,7 +226,7 @@ Dictionary::Ptr ApiActions::AcknowledgeProblem(const ConfigObject::Ptr& object, Comment::AddComment(checkable, CommentAcknowledgement, HttpUtility::GetLastParameter(params, "author"), HttpUtility::GetLastParameter(params, "comment"), persistent, timestamp); checkable->AcknowledgeProblem(HttpUtility::GetLastParameter(params, "author"), - HttpUtility::GetLastParameter(params, "comment"), sticky, notify, timestamp); + HttpUtility::GetLastParameter(params, "comment"), sticky, notify, persistent, timestamp); return ApiActions::CreateResult(200, "Successfully acknowledged problem for object '" + checkable->GetName() + "'."); } diff --git a/lib/icinga/externalcommandprocessor.cpp b/lib/icinga/externalcommandprocessor.cpp index 04977924f..6c3469f76 100644 --- a/lib/icinga/externalcommandprocessor.cpp +++ b/lib/icinga/externalcommandprocessor.cpp @@ -635,7 +635,7 @@ void ExternalCommandProcessor::AcknowledgeSvcProblem(double, const std::vectorGetName() << "'" << (notify ? "" : ". Disabled notification"); Comment::AddComment(service, CommentAcknowledgement, arguments[5], arguments[6], persistent, 0); - service->AcknowledgeProblem(arguments[5], arguments[6], sticky ? AcknowledgementSticky : AcknowledgementNormal, persistent, notify); + service->AcknowledgeProblem(arguments[5], arguments[6], sticky ? AcknowledgementSticky : AcknowledgementNormal, notify, persistent); } void ExternalCommandProcessor::AcknowledgeSvcProblemExpire(double, const std::vector& arguments) @@ -699,7 +699,7 @@ void ExternalCommandProcessor::AcknowledgeHostProblem(double, const std::vector< BOOST_THROW_EXCEPTION(std::invalid_argument("The host '" + arguments[0] + "' is OK.")); Comment::AddComment(host, CommentAcknowledgement, arguments[4], arguments[5], persistent, 0); - host->AcknowledgeProblem(arguments[4], arguments[5], sticky ? AcknowledgementSticky : AcknowledgementNormal, persistent, notify); + host->AcknowledgeProblem(arguments[4], arguments[5], sticky ? AcknowledgementSticky : AcknowledgementNormal, notify, persistent); } void ExternalCommandProcessor::AcknowledgeHostProblemExpire(double, const std::vector& arguments)