diff --git a/components/notification/notification-type.conf b/components/notification/notification-type.conf index bcb3f676b..54bf6d5d6 100644 --- a/components/notification/notification-type.conf +++ b/components/notification/notification-type.conf @@ -18,4 +18,5 @@ ******************************************************************************/ %type NotificationComponent { + %attribute %number "enable_ha" } diff --git a/components/notification/notificationcomponent.cpp b/components/notification/notificationcomponent.cpp index faf2a7092..efe0b66ea 100644 --- a/components/notification/notificationcomponent.cpp +++ b/components/notification/notificationcomponent.cpp @@ -75,6 +75,9 @@ void NotificationComponent::NotificationTimerHandler(void) BOOST_FOREACH(const Notification::Ptr& notification, DynamicType::GetObjects()) { Checkable::Ptr checkable = notification->GetCheckable(); + if (checkable->IsPaused() && GetEnableHA()) + continue; + if (!IcingaApplication::GetInstance()->GetEnableNotifications() || !checkable->GetEnableNotifications()) continue; @@ -128,5 +131,8 @@ void NotificationComponent::NotificationTimerHandler(void) void NotificationComponent::SendNotificationsHandler(const Checkable::Ptr& checkable, NotificationType type, const CheckResult::Ptr& cr, const String& author, const String& text) { + if (checkable->IsPaused() && GetEnableHA()) + return; + checkable->SendNotifications(type, cr, author, text); } diff --git a/components/notification/notificationcomponent.ti b/components/notification/notificationcomponent.ti index 1758f9537..53a28d7b3 100644 --- a/components/notification/notificationcomponent.ti +++ b/components/notification/notificationcomponent.ti @@ -5,6 +5,9 @@ namespace icinga class NotificationComponent : DynamicObject { + [config] bool enable_ha (EnableHA) { + default {{{ return true; }}} + }; }; }