-
Notifications
You must be signed in to change notification settings - Fork 1
/
ilert_icinga2.conf
53 lines (43 loc) · 1.55 KB
/
ilert_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
38
39
40
41
42
43
44
45
46
47
48
49
50
object User "ilert" {
display_name = "iLert"
groups = [ "icingaadmins" ]
states = [ OK, Warning, Critical, Unknown]
types = [ Problem, Recovery, Acknowledgement ]
vars.additional_notes = "This user maps to an alert source in iLert."
pager = "<YOUR API KEY>"
}
object NotificationCommand "ilert-notification" {
import "plugin-notification-command"
command = "python3 /usr/local/bin/ilert_nagios.py -m save"
env = {
ICINGA_CONTACTPAGER = "$user.pager$"
ICINGA_NOTIFICATIONTYPE = "$notification.type$"
ICINGA_LONGDATETIME = "$icinga.long_date_time$"
ICINGA_HOSTADDRESS = "$address$"
ICINGA_HOSTNAME = "$host.name$"
ICINGA_HOSTALIAS = "$host.display_name$"
ICINGA_HOSTSTATE = "$host.state$"
ICINGA_HOSTOUTPUT="$host.output$"
ICINGA_SERVICESTATE = "$service.state$"
ICINGA_SERVICEDESC = "$service.name$"
ICINGA_SERVICEDISPLAYNAME = "$service.display_name$"
ICINGA_SERVICEOUTPUT = "$service.output$"
ICINGA_NOTIFICATIONCOMMENT = "$notification.comment$"
}
}
apply Notification "ilert-host-notification" to Host {
command = "ilert-notification"
states = [ Up, Down ]
types = [ Problem, Acknowledgement, Recovery ]
period = "24x7"
users = [ "ilert" ]
assign where host.vars.notification.enable_ilert == true
}
apply Notification "ilert-service-notification" to Service {
command = "ilert-notification"
states = [ OK, Warning, Critical, Unknown ]
types = [ Problem, Acknowledgement, Recovery ]
period = "24x7"
users = [ "ilert" ]
assign where service.vars.notification.enable_ilert == true
}