From: Michael Friedrich Date: Fri, 20 Jun 2014 08:34:00 +0000 (+0200) Subject: Notifications: Check if disabled when sending reminder X-Git-Tag: v2.0.1~46 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c4bfff27c7597dbde2828eb1c1b72161d5bddddf;p=icinga2 Notifications: Check if disabled when sending reminder refs #6510 --- diff --git a/components/notification/notificationcomponent.cpp b/components/notification/notificationcomponent.cpp index cec7cc4d0..faf2a7092 100644 --- a/components/notification/notificationcomponent.cpp +++ b/components/notification/notificationcomponent.cpp @@ -19,6 +19,7 @@ #include "notification/notificationcomponent.hpp" #include "icinga/service.hpp" +#include "icinga/icingaapplication.hpp" #include "base/dynamictype.hpp" #include "base/objectlock.hpp" #include "base/logger_fwd.hpp" @@ -74,6 +75,9 @@ void NotificationComponent::NotificationTimerHandler(void) BOOST_FOREACH(const Notification::Ptr& notification, DynamicType::GetObjects()) { Checkable::Ptr checkable = notification->GetCheckable(); + if (!IcingaApplication::GetInstance()->GetEnableNotifications() || !checkable->GetEnableNotifications()) + continue; + if (notification->GetInterval() <= 0 && notification->GetLastProblemNotification() > checkable->GetLastHardStateChange()) continue;