Implemented notification_interval attribute for hosts.

This commit is contained in:
Gunnar Beutner 2013-02-27 18:15:01 +01:00
parent 39b0806778
commit 6bf086dc91
3 changed files with 8 additions and 0 deletions

View 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;

View 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 "*"
},

View 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())