-
Notifications
You must be signed in to change notification settings - Fork 0
/
ilert-icinga.conf
63 lines (53 loc) · 2.08 KB
/
ilert-icinga.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
51
52
53
54
55
56
57
58
59
60
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-icinga.py --mode save --endpoint https://api.ilert.com"
env = {
ICINGA_CONTACTPAGER = "$user.pager$"
ICINGA_NOTIFICATIONTYPE = "$notification.type$"
ICINGA_NOTIFICATIONAUTHORNAME = "$notification.author$"
ICINGA_NOTIFICATIONCOMMENT = "$notification.comment$"
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_HOSTZONE="$host.zone$"
ICINGA_HOSTNOTESURL = "$host.notes_url$"
ICINGA_HOSTACTIONURL = "$host.action_url$"
ICINGA_HOSTICONIMAGE = "$host.icon_image$"
ICINGA_HOSTICONIMAGEALT = "$host.icon_image_alt$"
ICINGA_SERVICESTATE = "$service.state$"
ICINGA_SERVICEDESC = "$service.name$"
ICINGA_SERVICEDISPLAYNAME = "$service.display_name$"
ICINGA_SERVICEOUTPUT = "$service.output$"
ICINGA_SERVICENOTESURL = "$service.notes_url$"
ICINGA_SERVICEACTIONURL = "$service.action_url$"
ICINGA_SERVICEICONIMAGE = "$service.icon_image$"
ICINGA_SERVICEICONIMAGEALT = "$service.icon_image_alt$"
}
}
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
}