mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-23 21:55:03 +02:00
parent
e31d520f6b
commit
efafcecced
@ -18,4 +18,5 @@
|
|||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
%type NotificationComponent {
|
%type NotificationComponent {
|
||||||
|
%attribute %number "enable_ha"
|
||||||
}
|
}
|
||||||
|
@ -75,6 +75,9 @@ void NotificationComponent::NotificationTimerHandler(void)
|
|||||||
BOOST_FOREACH(const Notification::Ptr& notification, DynamicType::GetObjects<Notification>()) {
|
BOOST_FOREACH(const Notification::Ptr& notification, DynamicType::GetObjects<Notification>()) {
|
||||||
Checkable::Ptr checkable = notification->GetCheckable();
|
Checkable::Ptr checkable = notification->GetCheckable();
|
||||||
|
|
||||||
|
if (checkable->IsPaused() && GetEnableHA())
|
||||||
|
continue;
|
||||||
|
|
||||||
if (!IcingaApplication::GetInstance()->GetEnableNotifications() || !checkable->GetEnableNotifications())
|
if (!IcingaApplication::GetInstance()->GetEnableNotifications() || !checkable->GetEnableNotifications())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -128,5 +131,8 @@ void NotificationComponent::NotificationTimerHandler(void)
|
|||||||
void NotificationComponent::SendNotificationsHandler(const Checkable::Ptr& checkable, NotificationType type,
|
void NotificationComponent::SendNotificationsHandler(const Checkable::Ptr& checkable, NotificationType type,
|
||||||
const CheckResult::Ptr& cr, const String& author, const String& text)
|
const CheckResult::Ptr& cr, const String& author, const String& text)
|
||||||
{
|
{
|
||||||
|
if (checkable->IsPaused() && GetEnableHA())
|
||||||
|
return;
|
||||||
|
|
||||||
checkable->SendNotifications(type, cr, author, text);
|
checkable->SendNotifications(type, cr, author, text);
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,9 @@ namespace icinga
|
|||||||
|
|
||||||
class NotificationComponent : DynamicObject
|
class NotificationComponent : DynamicObject
|
||||||
{
|
{
|
||||||
|
[config] bool enable_ha (EnableHA) {
|
||||||
|
default {{{ return true; }}}
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user