[icinga-checkins] icinga.org: icinga2/next: Notifications: Check if disabled when sending reminder

git at icinga.org git at icinga.org
Fri Jun 20 10:34:34 CEST 2014


Module: icinga2
Branch: next
Commit: c4bfff27c7597dbde2828eb1c1b72161d5bddddf
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=c4bfff27c7597dbde2828eb1c1b72161d5bddddf

Author: Michael Friedrich <michael.friedrich at netways.de>
Date:   Fri Jun 20 10:34:00 2014 +0200

Notifications: Check if disabled when sending reminder

refs #6510

---

 components/notification/notificationcomponent.cpp |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/components/notification/notificationcomponent.cpp b/components/notification/notificationcomponent.cpp
index cec7cc4..faf2a70 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<Notification>()) {
 		Checkable::Ptr checkable = notification->GetCheckable();
 
+		if (!IcingaApplication::GetInstance()->GetEnableNotifications() || !checkable->GetEnableNotifications())
+			continue;
+
 		if (notification->GetInterval() <= 0 && notification->GetLastProblemNotification() > checkable->GetLastHardStateChange())
 			continue;
 



More information about the icinga-checkins mailing list