Seff
Seff

Reputation: 1807

Icinga2: Re-notification interval per service basis

The default re-notification interval is 30m, and it can be changed via the Notification object. But it will affect all the services.

I want to set re-notification interval to 5m for critical service and disable re-notification for low priority, leave the default 30m for rest of the services.

Found a similar discussion here, but no solution yet: https://www.reddit.com/r/icinga/comments/73uc8s/setting_notification_interval_icingaweb2/

Upvotes: 2

Views: 1717

Answers (1)

Seff
Seff

Reputation: 1807

Found an indirect method to achieve this, using custom vars defined under Service object, and access them via Notification object.

A sample config is given below:

apply Service "service1" {
  # service conf goes here
  vars.notification.interval = 5m
}

apply Service "service2" {
  # service conf goes here
  vars.notification.interval = 2h
}

apply Service "service3" {
  # service conf goes here
  vars.notification.interval = 0
}

apply Service "service4" {
  # service conf goes here
}

apply Notification "notifications1" to Service {
  # notification conf goes here
  interval = (service.vars.notification.interval) || 20m
}

In the above example, the re-notification interval as follows:

service1: 5 minutes
service2: 2 hours
service3: Notify once, no re-notificaiton
service4: 20 minutes (System default is 30m, here we modified the default to 20 minutes)

Explanation:

interval = (service.vars.notification.interval) || 20m

The value for the variable interval will be set to service.vars.notification.interval if it is present, else set to 20m

Upvotes: 3

Related Questions