We are attempting to set up a set of notification commands based around a common template. My goal was to build the notification commands and their templates completely in Icinga Director. I built a NotificationCommand template and created a number of arguments that need to be passed to the command. See below:
template NotificationCommand "NQ2 Host Notification Command Template" {
import "plugin-notification-command"
import "NQ2 Notification Command Template"
arguments += {
check_type = {
description = "Is the alert for a host or a service?"
order = 0
repeat_key = false
required = true
skip_key = true
value = "host"
}
contact_email = {
description = "Email address to send notification to (Should be depricated when page is through NQ2)"
order = 13
repeat_key = false
required = true
skip_key = true
}
format_type = {
description = "Are we expecting to ticket or page?"
order = 1
repeat_key = false
required = true
skip_key = true
}
host_ack_author = {
description = "User who acknowledged the alert"
order = 10
repeat_key = false
required = true
skip_key = true
}
host_ack_comment = {
description = "Comment left by user when acknowledging an alert"
order = 11
repeat_key = false
required = true
skip_key = true
}
host_address = {
description = "Either hostname or ip address for the host"
order = 5
repeat_key = false
required = true
skip_key = true
value = "$host.address$"
}
host_output = {
description = "The last check’s output"
order = 6
repeat_key = false
required = true
skip_key = true
value = "$host.output$"
}
host_state = {
description = "State of the host (UP or DOWN)"
order = 4
repeat_key = false
required = true
skip_key = true
value = "$host.state$"
}
hostname = {
description = "Hostname"
order = 3
repeat_key = false
required = true
skip_key = true
value = "$host.name$"
}
icinga_url = {
description = "URL for icinga-master"
order = 16
repeat_key = false
required = true
skip_key = true
value = "icinga.corp.net"
}
long_date_time = {
description = "The last state change’s timestamp."
order = 7
repeat_key = false
required = true
skip_key = true
}
long_host_output = {
order = 9
repeat_key = false
required = true
skip_key = true
}
notification_type = {
description = "What type of notification should be sent"
order = 2
repeat_key = false
required = true
skip_key = true
value = "$notification.type$"
}
runbook = {
description = "Runbook"
order = 8
repeat_key = false
required = true
skip_key = true
}
ta_sitename = {
description = "Zone the host is located in"
order = 12
repeat_key = false
required = true
skip_key = true
value = "$host.zone$"
}
team_name = {
description = "Team who owns the server"
order = 14
repeat_key = false
required = true
skip_key = true
value = "$host.vars.team$"
}
ticket_priority = {
description = "Level of priority for a ticket (if generating one)"
order = 15
repeat_key = false
required = true
skip_key = true
}
}
}
However, when I create a notification command that inherits that template, it doesn’t inherit any of the arguments. Is this expected behavior? I would think this defeats a lot of the usefulness of notification templates.
object NotificationCommand "NQ Host Ticket Notification Command" {
import "plugin-notification-command"
import "NQ2 Host Notification Command Template"
}
Versions:
[root@icinga-master01d ~]# icingacli director --version
Icinga Web 2 2.7.3
Git Commit 06cabfe8ba28cf545a42c92f25484383191a4e51
PHP Version 7.1.30
MODULE VERSION
director master
incubator 0.5.0
ipl v0.4.0
monitoring 2.7.3
reactbundle 0.7.0