From bfe7d46a685bd9d9d21519eeff85f8c301058e32 Mon Sep 17 00:00:00 2001 From: Noah Hilverling Date: Tue, 7 Aug 2018 10:02:13 +0200 Subject: [PATCH] Only send acknowledgement notification if user received a problem notification refs #6047 --- lib/icinga/notification.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/icinga/notification.cpp b/lib/icinga/notification.cpp index a53c17e12..85ca54da7 100644 --- a/lib/icinga/notification.cpp +++ b/lib/icinga/notification.cpp @@ -409,6 +409,15 @@ void Notification::BeginExecuteNotification(NotificationType type, const CheckRe } } + /* on acknowledgement, check if user was notified before */ + if (type == NotificationAcknowledgement) { + if (!notifiedProblemUsers->Contains(userName)) { + Log(LogNotice, "Notification") + << "We did not notify user '" << userName << "' for a problem before. Not sending acknowledgement notification."; + continue; + } + } + Log(LogInformation, "Notification") << "Sending " << (reminder ? "reminder " : "") << "'" << NotificationTypeToStringInternal(type) << "' notification '" << GetName() << "' for user '" << userName << "'";