I’m currently trying to assign two notifications with the same “assign” rule but it doesn’t work.
I must do the following behaviour for my notifications :
Send a notification immediatly to some users
Send a delayed notification in case no ACK or RECOVERY status happend after 20min
I tried the following configurations (notifications.conf) :
apply Notification "pager-sms-host" to Host {
command = "sms-host-notification"
user_groups = [ "pager_group" ]
assign where "pager" in host.vars.notifications
interval = 0 # Disable re-notification
}
apply Notification "notify-alert-delay-host" to Host {
command = "alert-delay-host"
users = [ "rescue_user" ]
assign where "pager" in host.vars.notifications
interval = 0 # Disable re-notification
times.begin = 20m
}
The problem is that only the first notification is applied to the hosts having “pager” in vars.notifications. I can’t assign the second to the same host.
Is there any solution to make the behaviour discribed ?
And one final question : with the times.begin instruction, if an ACK or a RECOVERY occurs before the notification should be send, does the notification still be send ?
What is the output of icinga2 object list --type notification --name 'SomeHost!pager-sms-host'
and icinga2 object list --type notification --name 'SomeHost!notify-alert-delay-host
No, the delayed notification will only be sent if the problem persists/is not handled.
I think I found a workaround. To make multiple notifications on same “assign” instruction, I created another file where I put my other configuration.
For example, I had one file called notifications.conf containing all notification types. When I put another notification with the same assign value, only the first one was executed.
To set another Notification with the same assign value, I created the file notifications_delay.conf in the same folder and now it works.