Example:
Thanks to @dverkade for the updated template and screenshot 😄
- Set up a new incoming webhook /services/new/incoming-webhook for your team
- Add slack-service-notification.sh to /etc/icinga2/scripts directory
- Add the contents of slack-service-notification.conf to your templates.conf (or keep it separate depending on your setup)
- Add the contents of slack-service-notification-command.conf to your commands.conf (or keep it separate depending on your setup)
- Add an entry to your notifications.conf (see example below)
apply Notification "slack" to Service {
import "slack-service-notification"
user_groups = [ "oncall" ]
interval = 30m
assign where host.vars.sla == "24x7"
}
- Set up a new user and usergroup
object User "oncall_alerts" {
import "generic-user"
display_name = "oncall alerts"
groups = [ "oncall" ]
states = [ OK, Warning, Critical ]
types = [ Problem, Recovery ]
email = "[email protected]"
}
object UserGroup "oncall" {
display_name = "oncall"
}