Hello community,
at work we have a setup that consists of
- 2 Master Nodes with Director (zone==master)
- 5 Satellites (zone==fqdn)
- lots of Clients (zone==fqdn)
I upgraded the software on all members to 2.11.3. The notification feature is disabled on all but the master nodes.
We are using a custom notification script that creates tickets via REST API in our ticketsystem. For two of my satellites and their children the notifications are not working. The other ones are forwarding their notifications to one of the master nodes and the script is being called just fine.
I looked inside the Analyze Notification Results paragraph in the documentation, but I cannot get the Icinga API to output anything as “last_notification_result”.
It just outputs:
{
"error": 400.0,
"status": "Invalid field specified: last_notification_result"
}
What can I do to display/further debug why no notifications are being relayed to my masters?
PS: The custom notification script written in python logs to syslog facility 1 when being called with log.info("Notification was triggered with the following arguments: %s" % (sys.argv))
but for those two satellites I don’t get these lines which means the notification script on the master is not even being called.
The debug.log only prints lines like:
grep -ir notification /var/log/icinga2
/var/log/icinga2/debug.log:[2020-03-30 11:37:07 +0200] notice/JsonRpcConnection: Received 'event::SetForceNextNotification' message from identity 'master-2'.
/var/log/icinga2/debug.log:[2020-03-30 11:37:07 +0200] notice/ApiListener: Relaying 'event::SetForceNextNotification' message
Mehr Info
Notification Template:template Notification "template-service-notification-otrs-customername" {
command = "service-otrscreation"
interval = 0s
states = [ Critical, Warning ]
types = [ Custom, Problem ]
users = [ "icinga_customername" ]
vars.otrs_customer_user = "icinga_customername"
}
Notification Applyrule:
apply Notification "service-notifications-customername" to Service {
command = "service-otrscreation"
interval = 0s
assign where "customername in host.groups
states = [ Critical, Warning ]
types = [ Custom, Problem ]
users = [ "icinga_customername" ]
vars.otrs_customer_user = "icinga_customername"
}
Notification Command:
object NotificationCommand "service-otrscreation" {
import "plugin-notification-command"
command = [ "/usr/lib64/nagios/plugins/create_otrs" ]
timeout = 2m
arguments += {
"--type" = {
repeat_key = false
required = true
value = "2"
}
"-C" = {
repeat_key = false
required = false
value = "$host.vars.otrs_customer_user$"
}
"-K" = {
repeat_key = false
required = true
value = "$host.vars.otrs_id$"
}
"-T" = {
repeat_key = false
required = true
value = "$service.display_name$ is $service.state$ on $host.display_name$"
}
"-b" = "$service.output$"
"-c" = {
repeat_key = false
required = false
value = "/etc/icinga2/otrs.ini"
}
"-q" = {
repeat_key = false
required = true
value = "5"
}
"-s" = {
repeat_key = false
required = true
value = "13"
}
}
}