From: Michael Friedrich Date: Thu, 17 Nov 2016 10:46:40 +0000 (+0100) Subject: Fix that custom notifications do not reset force_next_notification X-Git-Tag: v2.6.0~54 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a13e6b3e87adc928974c8b5ef9b7da44c9005dee;p=icinga2 Fix that custom notifications do not reset force_next_notification This attribute is stored in the state file forever as well. Will cause forced notifications ignoring state/type filters. fixes #12670 --- diff --git a/lib/icinga/checkable-notification.cpp b/lib/icinga/checkable-notification.cpp index ac7761652..a9c804a7a 100644 --- a/lib/icinga/checkable-notification.cpp +++ b/lib/icinga/checkable-notification.cpp @@ -48,14 +48,14 @@ void Checkable::SendNotifications(NotificationType type, const CheckResult::Ptr& bool force = GetForceNextNotification(); + SetForceNextNotification(false); + if (!IcingaApplication::GetInstance()->GetEnableNotifications() || !GetEnableNotifications()) { if (!force) { Log(LogInformation, "Checkable") << "Notifications are disabled for service '" << GetName() << "'."; return; } - - SetForceNextNotification(false); } Log(LogInformation, "Checkable")