]> granicus.if.org Git - icinga2/commitdiff
Implemented notification_interval attribute for hosts.
authorGunnar Beutner <gunnar.beutner@netways.de>
Wed, 27 Feb 2013 17:15:01 +0000 (18:15 +0100)
committerGunnar Beutner <gunnar.beutner@netways.de>
Wed, 27 Feb 2013 17:15:01 +0000 (18:15 +0100)
components/notification/notificationcomponent.cpp
itl/types.conf
lib/icinga/host.cpp

index 60793cfd35054117a3869b8126118769b60f8493..0d5b44dd8497b4c038e019fb79810660562c4836 100644 (file)
@@ -67,6 +67,9 @@ void NotificationComponent::NotificationTimerHandler(void)
                if (service->GetState() == StateOK)
                        continue;
 
+               if (service->GetNotificationInterval() <= 0)
+                       continue;
+
                if (service->GetLastNotification() > now - service->GetNotificationInterval())
                        continue;
 
index d7e763991fa020824dfcd1e3005c026aeec27a38..af7b941970926bdcc1ed5c81faccf002874cd5e0 100644 (file)
@@ -125,6 +125,7 @@ type Host {
        %attribute number "max_check_attempts",
        %attribute number "check_interval",
        %attribute number "retry_interval",
+       %attribute number "notification_interval",
        %attribute dictionary "macros" {
                %attribute string "*"
        },
index 62b9c1673040e098d50da93aa466784000d29a6f..6cb24c5559eb214a8e8893a4f756037c3c261b28 100644 (file)
@@ -173,6 +173,10 @@ static void CopyServiceAttributes(TDict serviceDesc, const ConfigItemBuilder::Pt
        if (!short_name.IsEmpty())
                builder->AddExpression("short_name", OperatorSet, short_name);
 
+       Value notification_interval = serviceDesc->Get("notification_interval");
+       if (!notification_interval.IsEmpty())
+               builder->AddExpression("notification_interval", OperatorSet, notification_interval);
+
        if (copyServiceAttrs) {
                Value servicedependencies = serviceDesc->Get("servicedependencies");
                if (!servicedependencies.IsEmpty())