]> granicus.if.org Git - icinga2/commitdiff
cluster: Fix duplicate acknowledgement comments.
authorGunnar Beutner <gunnar.beutner@netways.de>
Thu, 29 Aug 2013 12:01:40 +0000 (14:01 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Thu, 29 Aug 2013 12:01:40 +0000 (14:01 +0200)
lib/icinga/externalcommandprocessor.cpp
lib/icinga/service.cpp

index 99de51bdc1cecec57ef188c65891874b63b7d886..876cb2aaf2996e8bfeeac2d11a8969512f3afe80 100644 (file)
@@ -508,6 +508,7 @@ void ExternalCommandProcessor::AcknowledgeSvcProblem(double, const std::vector<S
 
        Log(LogInformation, "icinga", "Setting acknowledgement for service '" + service->GetName() + "'");
 
+       service->AddComment(CommentAcknowledgement, arguments[5], arguments[6], 0);
        service->AcknowledgeProblem(arguments[5], arguments[6], sticky ? AcknowledgementSticky : AcknowledgementNormal);
 }
 
@@ -526,6 +527,7 @@ void ExternalCommandProcessor::AcknowledgeSvcProblemExpire(double, const std::ve
 
        Log(LogInformation, "icinga", "Setting timed acknowledgement for service '" + service->GetName() + "'");
 
+       service->AddComment(CommentAcknowledgement, arguments[6], arguments[7], 0);
        service->AcknowledgeProblem(arguments[6], arguments[7], sticky ? AcknowledgementSticky : AcknowledgementNormal, timestamp);
 }
 
@@ -556,6 +558,7 @@ void ExternalCommandProcessor::AcknowledgeHostProblem(double, const std::vector<
                if (service->GetState() == StateOK)
                        BOOST_THROW_EXCEPTION(std::invalid_argument("The host '" + arguments[0] + "' is OK."));
 
+               service->AddComment(CommentAcknowledgement, arguments[4], arguments[5], 0);
                service->AcknowledgeProblem(arguments[4], arguments[5], sticky ? AcknowledgementSticky : AcknowledgementNormal);
        }
 }
@@ -576,6 +579,7 @@ void ExternalCommandProcessor::AcknowledgeHostProblemExpire(double, const std::v
                if (service->GetState() == StateOK)
                        BOOST_THROW_EXCEPTION(std::invalid_argument("The host '" + arguments[0] + "' is OK."));
 
+               service->AddComment(CommentAcknowledgement, arguments[5], arguments[6], 0);
                service->AcknowledgeProblem(arguments[5], arguments[6], sticky ? AcknowledgementSticky : AcknowledgementNormal, timestamp);
        }
 }
index ff874b0c21d75d222576b76881364ad5112a05f6..75c195bf587b166d97038a36d9a386e49c6270c2 100644 (file)
@@ -242,8 +242,6 @@ void Service::AcknowledgeProblem(const String& author, const String& comment, Ac
                m_AcknowledgementExpiry = expiry;
        }
 
-       (void) AddComment(CommentAcknowledgement, author, comment, 0);
-
        OnNotificationsRequested(GetSelf(), NotificationAcknowledgement, GetLastCheckResult(), author, comment);
 
        Utility::QueueAsyncCallback(bind(boost::ref(OnAcknowledgementSet), GetSelf(), author, comment, type, expiry, authority));