forked from mdcollins05/PagerDuty-Icinga2
-
Notifications
You must be signed in to change notification settings - Fork 1
/
pagerduty-icinga2.conf
37 lines (31 loc) · 1.22 KB
/
pagerduty-icinga2.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
object User "pagerduty" {
pager = "YOUR_OPENDUTY_TOKEN"
groups = [ "icingaadmins" ]
display_name = "PagerDuty Notification User"
states = [ OK, Warning, Critical, Unknown ]
types = [ Problem, Recovery ]
}
object NotificationCommand "notify-service-by-pagerduty" {
import "plugin-notification-command"
command = "/usr/local/bin/openduty_wrapper -t $notification.type$ -k $user.pager$ -i $host.name$:$service.name$ -d $service.name$ -e $service.output$"
}
object NotificationCommand "notify-host-by-pagerduty" {
import "plugin-notification-command"
command = "/usr/local/bin/openduty_wrapper -t $notification.type$ -k $user.pager$ -i $host.name$ -d $host.state$ -e $host.output$"
}
apply Notification "pagerduty-service" to Service {
command = "notify-service-by-pagerduty"
states = [ OK, Warning, Critical, Unknown ]
types = [ Problem, Acknowledgement, Recovery ]
period = "24x7"
users = [ "pagerduty" ]
assign where service.vars.enable_pagerduty == true
}
apply Notification "pagerduty-host" to Host {
command = "notify-host-by-pagerduty"
states = [ Up, Down ]
types = [ Problem, Acknowledgement, Recovery ]
period = "24x7"
users = [ "pagerduty" ]
assign where host.vars.enable_pagerduty == true
}