Notification interval different values

I would like to change notification interval

I would like that:

  • normal workdays, notification interval = 14400 (4 hours)

  • weekend, notification interval = 0 (only one time the notification happens)

I tried to create two timeperiods “workday” and “weekend” different notification template with the different intervals, but when I import two notification templates on a single notification, it doesn’t mix both interval, but only one.

How could I solve my issue?

Thanks a lot

icinga2 - The Icinga 2 network monitoring daemon (version: r2.13.1-1)

Icinga Web 2 Version
Git commit
PHP Version
Git commit date

businessprocess 2.3.1
director master
fileshipper 1.1.0
monitoring 2.9.3

Im also fairly new to icinga, but cant you just create two notifications?
They wont interfere, because they have separate timeslots.

I have 32 notifications, so I wouldn’t like duplicate all, only to put different interval

Just glancing, I think the only way to accomplish this is to have 2 notifications, using 2 time periods, and 2 different notification intervals.

Time Period 1:
weekdays only

Time Period 2:
weekends only

Notify Rule 1:
weekdays, notification interval 4 hours

Notify Rule 2:
weekends, notification interval disabled

1 Like

I created two timeperiod as you explained me.
I created two Notify Templates

When I put the two templates into notification apply rule, it doesn’t work.
It doesn’t apply both rules but it uses only one imports:

apply Notification "Notify Me About Hosts-ISS" to Host {
    import "Generic Host Alarm By Email Workday"
    import "Generic Host Alarm By Email Weekend"

    assign where host.vars.notification_type == "Mail" && "ISS" in host.vars.notification_recipient
    user_groups = [ "ISS" ]

How could I solve the issue?

1 Like

Honestly, I didn’t think about multiple imports (or know how it works off hand, coffee might fix that).

Which import is it using? How can you tell it’s only using one (ie, it’s not the weekend yet, so the weekend rule shouldn’t be in effect).

You could use the templates to create 2 different Notification apply rules and see if that helps, that was my intended solution, but I like the idea of multiple imports better if it works :slight_smile:

With multiple import it mixed timeperiod and notification’s interval, so it doesn’t work right.

Can you show the templates and the evidence showing that they’re mixed?

Ah, I think the multiple imports won’t work for intervals and time periods, since only one value can be defined for those.