2024-09-26 14:44:31 +02:00
|
|
|
// https://git.dittberner.info/jan/icinga2-matrix-notification
|
|
|
|
|
|
|
|
object NotificationCommand "matrix-host-notification" {
|
|
|
|
import "plugin-notification-command"
|
2024-09-26 15:44:21 +02:00
|
|
|
command = [ PluginDir + "/matrix-host-notification" ]
|
2024-09-26 14:44:31 +02:00
|
|
|
arguments += {
|
|
|
|
"-4" = "$notification_address$"
|
|
|
|
"-6" = "$notification_address6$"
|
|
|
|
"-b" = "$notification_author$"
|
|
|
|
"-c" = "$notification_comment$"
|
|
|
|
"-d" = {
|
|
|
|
required = true
|
|
|
|
value = "$notification_date$"
|
|
|
|
}
|
|
|
|
"-i" = "$notification_icingaweb2url$"
|
|
|
|
"-l" = {
|
|
|
|
required = true
|
|
|
|
value = "$notification_hostname$"
|
|
|
|
}
|
|
|
|
"-m" = {
|
|
|
|
required = true
|
|
|
|
value = "$notification_matrix_room_id$"
|
|
|
|
}
|
|
|
|
"-n" = {
|
|
|
|
required = true
|
|
|
|
value = "$notification_hostdisplayname$"
|
|
|
|
}
|
|
|
|
"-o" = {
|
|
|
|
required = true
|
|
|
|
value = "$notification_hostoutput$"
|
|
|
|
}
|
|
|
|
"-s" = {
|
|
|
|
required = true
|
|
|
|
value = "$notification_hoststate$"
|
|
|
|
}
|
|
|
|
"-t" = {
|
|
|
|
required = true
|
|
|
|
value = "$notification_type$"
|
|
|
|
}
|
|
|
|
"-x" = {
|
|
|
|
required = true
|
|
|
|
value = "$notification_matrix_server$"
|
|
|
|
}
|
|
|
|
"-y" = {
|
|
|
|
required = true
|
|
|
|
value = "$notification_matrix_token$"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
vars.notification_address = "$address$"
|
|
|
|
vars.notification_address6 = "$address6$"
|
|
|
|
vars.notification_author = "$notification.author$"
|
|
|
|
vars.notification_comment = "$notification.comment$"
|
|
|
|
vars.notification_date = "$icinga.long_date_time$"
|
|
|
|
vars.notification_hostdisplayname = "$host.display_name$"
|
|
|
|
vars.notification_hostname = "$host.name$"
|
|
|
|
vars.notification_hostoutput = "$host.output$"
|
|
|
|
vars.notification_hoststate = "$host.state$"
|
|
|
|
vars.notification_type = "$notification.type$"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
object NotificationCommand "matrix-service-notification" {
|
|
|
|
import "plugin-notification-command"
|
2024-09-26 15:44:21 +02:00
|
|
|
command = [ PluginDir + "/matrix-service-notification" ]
|
2024-09-26 14:44:31 +02:00
|
|
|
arguments += {
|
|
|
|
"-4" = {
|
|
|
|
required = true
|
|
|
|
value = "$notification_address$"
|
|
|
|
}
|
|
|
|
"-6" = "$notification_address6$"
|
|
|
|
"-b" = "$notification_author$"
|
|
|
|
"-c" = "$notification_comment$"
|
|
|
|
"-d" = {
|
|
|
|
required = true
|
|
|
|
value = "$notification_date$"
|
|
|
|
}
|
|
|
|
"-e" = {
|
|
|
|
required = true
|
|
|
|
value = "$notification_servicename$"
|
|
|
|
}
|
|
|
|
"-i" = "$notification_icingaweb2url$"
|
|
|
|
"-l" = {
|
|
|
|
required = true
|
|
|
|
value = "$notification_hostname$"
|
|
|
|
}
|
|
|
|
"-m" = {
|
|
|
|
required = true
|
|
|
|
value = "$notification_matrix_room_id$"
|
|
|
|
}
|
|
|
|
"-n" = {
|
|
|
|
required = true
|
|
|
|
value = "$notification_hostdisplayname$"
|
|
|
|
}
|
|
|
|
"-o" = {
|
|
|
|
required = true
|
|
|
|
value = "$notification_serviceoutput$"
|
|
|
|
}
|
|
|
|
"-s" = {
|
|
|
|
required = true
|
|
|
|
value = "$notification_servicestate$"
|
|
|
|
}
|
2024-09-26 17:21:44 +02:00
|
|
|
"-t" = {
|
|
|
|
required = true
|
|
|
|
value = "$notification_type$"
|
|
|
|
}
|
2024-09-26 14:44:31 +02:00
|
|
|
"-u" = {
|
|
|
|
required = true
|
|
|
|
value = "$notification_servicedisplayname$"
|
|
|
|
}
|
|
|
|
"-x" = {
|
|
|
|
required = true
|
|
|
|
value = "$notification_matrix_server$"
|
|
|
|
}
|
|
|
|
"-y" = {
|
|
|
|
required = true
|
|
|
|
value = "$notification_matrix_token$"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
vars.notification_address = "$address$"
|
|
|
|
vars.notification_address6 = "$address6$"
|
|
|
|
vars.notification_author = "$notification.author$"
|
|
|
|
vars.notification_comment = "$notification.comment$"
|
|
|
|
vars.notification_date = "$icinga.long_date_time$"
|
|
|
|
vars.notification_hostdisplayname = "$host.display_name$"
|
|
|
|
vars.notification_hostname = "$host.name$"
|
|
|
|
vars.notification_servicedisplayname = "$service.display_name$"
|
|
|
|
vars.notification_serviceoutput = "$service.output$"
|
|
|
|
vars.notification_servicestate = "$service.state$"
|
|
|
|
vars.notification_type = "$notification.type$"
|
|
|
|
vars.notification_servicename = "$service.name$"
|
|
|
|
}
|