1- if (!globals.contains("NomaProcessEventUrl ")) {
2- const NomaProcessEventUrl = "http://localhost:5680/process-event"
1+ if (!globals.contains("IcingaNotificationsProcessEventUrl ")) {
2+ const IcingaNotificationsProcessEventUrl = "http://localhost:5680/process-event"
33}
4- if (!globals.contains("NomaIcingaWebUrl ")) {
5- const NomaIcingaWebUrl = "http://localhost/icingaweb2"
4+ if (!globals.contains("IcingaNotificationsIcingaWebUrl ")) {
5+ const IcingaNotificationsIcingaWebUrl = "http://localhost/icingaweb2"
66}
7- if (!globals.contains("NomaEventSourceId ")) {
7+ if (!globals.contains("IcingaNotificationsEventSourceId ")) {
88 // INSERT INTO source (id, type, name) VALUES (1, 'icinga2', 'Icinga 2')
9- const NomaEventSourceId = 1
9+ const IcingaNotificationsEventSourceId = 1
1010}
1111
12- object User "noma " {
12+ object User "icinga-notifications " {
1313 # Workaround, types filter here must exclude Problem, otherwise no Acknowledgement notifications are sent.
1414 # https://github.com/Icinga/icinga2/issues/9739
1515 types = [ Acknowledgement ]
@@ -31,7 +31,7 @@ var baseBody = {
3131 "--show-error" = { set_if = true }
3232 "url" = {
3333 skip_key = true
34- value = NomaProcessEventUrl
34+ value = IcingaNotificationsProcessEventUrl
3535 }
3636}
3737
@@ -73,7 +73,7 @@ var hostExtraTags = {{
7373 return tags
7474}}
7575
76- object NotificationCommand "noma-host-notification " use(hostBody, hostExtraTags) {
76+ object NotificationCommand "icinga-notifications-host " use(hostBody, hostExtraTags) {
7777 command = [ /* full command line generated from arguments */ ]
7878
7979 arguments = hostBody
@@ -83,9 +83,9 @@ object NotificationCommand "noma-host-notification" use(hostBody, hostExtraTags)
8383 event_author = "$notification.author$"
8484 event_message = "$notification.comment$"
8585 event_object_name = "$host.display_name$"
86- event_action_url = NomaIcingaWebUrl + "/icingadb/host?name=$host.name$"
86+ event_action_url = IcingaNotificationsIcingaWebUrl + "/icingadb/host?name=$host.name$"
8787 event_extra_tags = hostExtraTags
88- event_source_id = NomaEventSourceId
88+ event_source_id = IcingaNotificationsEventSourceId
8989 }
9090
9191 vars.event_type = {{
@@ -105,7 +105,7 @@ object NotificationCommand "noma-host-notification" use(hostBody, hostExtraTags)
105105 }}
106106}
107107
108- object EventCommand "noma- host-events-forwarder " use(hostBody, hostExtraTags) {
108+ object EventCommand "icinga-notifications- host-events" use(hostBody, hostExtraTags) {
109109 command = [ /* full command line generated from arguments */ ]
110110
111111 arguments = hostBody
@@ -115,9 +115,9 @@ object EventCommand "noma-host-events-forwarder" use(hostBody, hostExtraTags) {
115115 event_author = ""
116116 event_message = "$host.output$"
117117 event_object_name = "$host.display_name$"
118- event_action_url = NomaIcingaWebUrl + "/icingadb/host?name=$host.name$"
118+ event_action_url = IcingaNotificationsIcingaWebUrl + "/icingadb/host?name=$host.name$"
119119 event_extra_tags = hostExtraTags
120- event_source_id = NomaEventSourceId
120+ event_source_id = IcingaNotificationsEventSourceId
121121 }
122122
123123 vars.event_severity = {{
@@ -129,16 +129,16 @@ object EventCommand "noma-host-events-forwarder" use(hostBody, hostExtraTags) {
129129 }}
130130}
131131
132- template Host "generic-noma -host" default {
133- event_command = "noma- host-events-forwarder "
132+ template Host "generic-icinga-notifications -host" default {
133+ event_command = "icinga-notifications- host-events"
134134}
135135
136- apply Notification "noma-notifier " to Host {
137- command = "noma-host-notification "
136+ apply Notification "icinga-notifications-forwarder " to Host {
137+ command = "icinga-notifications-host "
138138
139139 types = [ Acknowledgement ]
140140
141- users = [ "noma " ]
141+ users = [ "icinga-notifications " ]
142142
143143 assign where true
144144}
@@ -186,7 +186,7 @@ var serviceExtraTags = {{
186186 return tags
187187}}
188188
189- object NotificationCommand "noma-service-notification " use(serviceBody, serviceExtraTags) {
189+ object NotificationCommand "icinga-notifications-service " use(serviceBody, serviceExtraTags) {
190190 command = [ /* full command line generated from arguments */ ]
191191
192192 arguments = serviceBody
@@ -197,9 +197,9 @@ object NotificationCommand "noma-service-notification" use(serviceBody, serviceE
197197 event_author = "$notification.author$"
198198 event_message = "$notification.comment$"
199199 event_object_name = "$host.display_name$: $service.display_name$"
200- event_action_url = NomaIcingaWebUrl + "/icingadb/service?name=$service.name$&host.name=$service.host.name$"
200+ event_action_url = IcingaNotificationsIcingaWebUrl + "/icingadb/service?name=$service.name$&host.name=$service.host.name$"
201201 event_extra_tags = serviceExtraTags
202- event_source_id = NomaEventSourceId
202+ event_source_id = IcingaNotificationsEventSourceId
203203 }
204204
205205 vars.event_type = {{
@@ -228,7 +228,7 @@ object NotificationCommand "noma-service-notification" use(serviceBody, serviceE
228228 }}
229229}
230230
231- object EventCommand "noma- service-events-forwarder " use(serviceBody, serviceExtraTags) {
231+ object EventCommand "icinga-notifications- service-events" use(serviceBody, serviceExtraTags) {
232232 command = [ /* full command line generated from arguments */ ]
233233
234234 arguments = serviceBody
@@ -239,9 +239,9 @@ object EventCommand "noma-service-events-forwarder" use(serviceBody, serviceExtr
239239 event_author = ""
240240 event_message = "$service.output$"
241241 event_object_name = "$host.display_name$: $service.display_name$"
242- event_action_url = NomaIcingaWebUrl + "/icingadb/service?name=$service.name$&host.name=$service.host.name$"
242+ event_action_url = IcingaNotificationsIcingaWebUrl + "/icingadb/service?name=$service.name$&host.name=$service.host.name$"
243243 event_extra_tags = serviceExtraTags
244- event_source_id = NomaEventSourceId
244+ event_source_id = IcingaNotificationsEventSourceId
245245 }
246246
247247 vars.event_severity = {{
@@ -262,16 +262,16 @@ object EventCommand "noma-service-events-forwarder" use(serviceBody, serviceExtr
262262 }}
263263}
264264
265- template Service "generic-noma -service" default {
266- event_command = "noma- service-events-forwarder "
265+ template Service "generic-icinga-notifications -service" default {
266+ event_command = "icinga-notifications- service-events"
267267}
268268
269- apply Notification "noma-notifier " to Service {
270- command = "noma-service-notification "
269+ apply Notification "icinga-notifications-forwarder " to Service {
270+ command = "icinga-notifications-service "
271271
272272 types = [ Acknowledgement ]
273273
274- users = [ "noma " ]
274+ users = [ "icinga-notifications " ]
275275
276276 assign where true
277277}
0 commit comments