/
opsgenie.conf
102 lines (96 loc) · 2.93 KB
/
opsgenie.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
object NotificationCommand "opsgenie-service-notification" {
import "plugin-notification-command"
vars.hgns = {{ host.groups.join(",") }}
vars.sgns = {{ service.groups.join(",") }}
command = [ "/usr/bin/icinga2opsgenie" ]
arguments = {
"-entityType" = "service"
"-t" = "$notification.type$"
"-ldt" = "$icinga.long_date_time$"
"-hn" = "$host.name$"
"-hdn" = "$host.display_name$"
"-hal" = "$host.display_name$"
"-haddr" = "$host.address$"
"-hs" = "$host.state$"
"-hsi" = "$host.state_id$"
"-lhs" = "$host.last_state$"
"-lhsi" = "$host.last_state_id$"
"-hst" = "$host.state_type$"
"-ha" = "$host.check_attempt$"
"-mha" = "$host.max_check_attempts$"
"-hl" = "$host.latency$"
"-het" = "$host.execution_time$"
"-hds" = "$host.duration_sec$"
"-hdt" = "$host.downtime_depth$"
"-hgn" = "$host.group$"
"-hgns" = "$command.vars.hgns$"
"-lhc" = "$host.last_check$"
"-lhsc" = "$host.last_state_change$"
"-ho" = "$host.output$"
"-hpd" = "$host.perfdata$"
"-s" = "$service.name$"
"-sdn" = "$service.display_name$"
"-ss" = "$service.state$"
"-ssi" = "$service.state_id$"
"-lss" = "$service.last_state$"
"-lssi" = "$service.last_state_id$"
"-sst" = "$service.state_type$"
"-sa" = "$service.check_attempt$"
"-sc" = "$service.check_command$"
"-msa" = "$service.max_check_attempts$"
"-sl" = "$service.latency$"
"-set" = "$service.execution_time$"
"-sds" = "$service.duration_sec$"
"-sdt" = "$service.downtime_depth$"
"-sgns" = "$command.vars.sgns$"
"-lsch" = "$service.last_check$"
"-lssc" = "$service.last_state_change$"
"-so" = "$service.output$"
"-spd" = "$service.perfdata$"
}
}
object NotificationCommand "opsgenie-host-notification" {
import "plugin-notification-command"
vars.hgns = {{ host.groups.join(",") }}
command = [ "/usr/bin/icinga2opsgenie" ]
arguments = {
"-entityType" = "host"
"-t" = "$notification.type$"
"-ldt" = "$icinga.long_date_time$"
"-hn" = "$host.name$"
"-hdn" = "$host.display_name$"
"-hal" = "$host.display_name$"
"-haddr" = "$host.address$"
"-hs" = "$host.state$"
"-hsi" = "$host.state_id$"
"-lhs" = "$host.last_state$"
"-lhsi" = "$host.last_state_id$"
"-hst" = "$host.state_type$"
"-ha" = "$host.check_attempt$"
"-mha" = "$host.max_check_attempts$"
"-hl" = "$host.latency$"
"-het" = "$host.execution_time$"
"-hds" = "$host.duration_sec$"
"-hdt" = "$host.downtime_depth$"
"-hgn" = "$host.group$"
"-hgns" = "$command.vars.hgns$"
"-lhc" = "$host.last_check$"
"-lhsc" = "$host.last_state_change$"
"-ho" = "$host.output$"
"-hpd" = "$host.perfdata$"
}
}
object User "opsgenie" {
import "generic-user"
display_name = "OpsGenie Contact"
}
apply Notification "notify-opsgenie-service" to Service {
command = "opsgenie-service-notification"
users = ["opsgenie"]
assign where service
}
apply Notification "notify-opsgenie-host" to Host {
command = "opsgenie-host-notification"
users = ["opsgenie"]
assign where host
}