From 1be64b9290c02b1b20a832f010e4f2be672e418e Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Wed, 23 Jan 2013 13:46:35 +0100 Subject: [PATCH] Bugfixes for acknowledgements. --- lib/icinga/externalcommand.cpp | 5 ++++- lib/icinga/service.cpp | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/icinga/externalcommand.cpp b/lib/icinga/externalcommand.cpp index d7f7496fc..86e50c85f 100644 --- a/lib/icinga/externalcommand.cpp +++ b/lib/icinga/externalcommand.cpp @@ -271,6 +271,7 @@ void ExternalCommand::AcknowledgeSvcProblem(double time, const vector& a Service::Ptr service = Service::GetByName(arguments[1]); + Logger::Write(LogInformation, "icinga", "Setting acknowledgement for service '" + service->GetName() + "'"); service->SetAcknowledgement(sticky ? AcknowledgementSticky : AcknowledgementNormal); service->SetAcknowledgementExpiry(0); } @@ -284,10 +285,11 @@ void ExternalCommand::AcknowledgeSvcProblemExpire(double time, const vectorGetName() + "'"); service->SetAcknowledgement(sticky ? AcknowledgementSticky : AcknowledgementNormal); service->SetAcknowledgementExpiry(timestamp); } @@ -302,6 +304,7 @@ void ExternalCommand::RemoveSvcAcknowledgement(double time, const vector Service::Ptr service = Service::GetByName(arguments[1]); + Logger::Write(LogInformation, "icinga", "Removing acknowledgement for service '" + service->GetName() + "'"); service->SetAcknowledgement(AcknowledgementNone); service->SetAcknowledgementExpiry(0); } diff --git a/lib/icinga/service.cpp b/lib/icinga/service.cpp index d9d49ec5c..a0ba70e1b 100644 --- a/lib/icinga/service.cpp +++ b/lib/icinga/service.cpp @@ -402,7 +402,8 @@ AcknowledgementType Service::GetAcknowledgement(void) if (expiry != 0 && expiry < Utility::GetTime()) { avalue = AcknowledgementNone; - SetAcknowledgementExpiry(avalue); + SetAcknowledgement(avalue); + SetAcknowledgementExpiry(0); } } -- 2.40.0