]> granicus.if.org Git - icinga2/commitdiff
Notifications: Check if disabled when sending reminder
authorMichael Friedrich <michael.friedrich@netways.de>
Fri, 20 Jun 2014 08:34:00 +0000 (10:34 +0200)
committerMichael Friedrich <michael.friedrich@netways.de>
Fri, 20 Jun 2014 08:34:00 +0000 (10:34 +0200)
refs #6510

components/notification/notificationcomponent.cpp

index cec7cc4d070725f77fac6bbcaab9551d14e6996c..faf2a7092ad6f20d4fb88aae44c273f4afa1575d 100644 (file)
@@ -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<Notification>()) {
                Checkable::Ptr checkable = notification->GetCheckable();
 
+               if (!IcingaApplication::GetInstance()->GetEnableNotifications() || !checkable->GetEnableNotifications())
+                       continue;
+
                if (notification->GetInterval() <= 0 && notification->GetLastProblemNotification() > checkable->GetLastHardStateChange())
                        continue;