Hello,
I created the following Notification Plugin Commands via Icinga2 Director, but
the arguments from the parent template don't appear to be used when the command
is executed.
- Email Template
- Email Host Template
- Standard Email Host (object)
template NotificationCommand "Email Template" {
import "plugin-notification-command"
arguments = {
"--host-address" = {
required = true
value = "$host.address$"
}
"--host-display-name" = {
required = true
value = "$host.display_name$"
}
"--host-name" = {
required = true
value = "$host.name$"
}
"--notification-author" = {
required = true
value = "$notification.author$"
}
"--notification-comment" = {
required = true
value = "$notification.comment$"
}
"--notification-type" = {
required = true
value = "$notification.type$"
}
"--user-email" = {
required = true
value = "$user.email$"
}
}
}
template NotificationCommand "Email Host Template" {
import "plugin-notification-command"
import "Email Template"
command = [ "/etc/icinga2/scripts/mail-host.py" ]
arguments = {
"--host-output" = {
required = true
value = "$host.output$"
}
"--host-state" = {
required = true
value = "$host.state$"
}
}
}
object NotificationCommand "Standard Email Host" {
import "plugin-notification-command"
import "Email Host Template"
}
[2016-10-17 12:38:02 -0400] warning/PluginNotificationTask: Notification
command for object 'hostname.example.com' (PID: 8596, arguments:
'/etc/icinga2/scripts/mail-host.py' '--host-output' 'PING CRITICAL - Packet
loss = 100%' '--host-state' 'DOWN') terminated with exit code 2, output: usage:
mail-host.py [-h] --host-name HOST_NAME --host-address HOST_ADDRESS
As you can see from the warning message, only the two arguments directly on
"Email Host Template" where used when executing the command.
Since it imports "Email Template", I expected the other arguments to be passed
along as well.
Should all of the arguments be inherited and used through when it is executed?
Changing it to:
object NotificationCommand "Standard Email Host" {
import "plugin-notification-command"
import "Email Template"
import "Email Host Template"
}
Didn't resolve the issue either, with the same two arguments being the only
ones used executing the command.
Happy to file a bug if that's the case.
Icinga2 2.5.4
Thanks,
Lee Clemens
___
icinga-users mailing list
icinga-users@lists.icinga.org
https://lists.icinga.org/mailman/listinfo/icinga-users