Icinga for JIRA - Automatic Ticket Creation doesnt work

Hello all, I am currently trying to set up automatic ticket creation with the Icingaweb2 module Jira. The manual ticket creation from Icinga already works wonderfully. Unfortunately, only the automatic creation does not work. Here is my configuration, maybe someone of you will notice a mistake.

Hello all, I am currently trying to set up automatic ticket creation with the Icingaweb2 module Jira. The manual ticket creation from Icinga already works wonderfully. Unfortunately, only the automatic creation does not work. Here is my configuration, maybe someone of you will notice a mistake.

Notification Template:

template Notification "Service (Jira)" {
    times.begin = 1m
    command = "JIRA Service Notification"
    interval = 0s
    period = "allTime"
    states = [ Critical, OK ]
    types = [ Problem ]
    user_groups = [ "jira" ]
    users = [ "jira" ]
}

Notification:

apply Notification "Service (Ticket)" to Service {
    import "Service (Jira)"

    times.begin = 1m
    interval = 0s
    period = "allTime"
    assign where service.name != ""
    states = [ Critical ]
    types = [ Problem ]
    user_groups = [ "Administratoren", "jira" ]
    users = [ "jira" ]
}

When I call up the notifications via History, I see that a notification has been sent to the user “Jira”. However, it never arrives in the ticket system. If I trigger the creation manually, it works.

I am thankful for any hints.

Best regards

Felix

  • Icinga Web 2 version: 2.9.3
  • Used modules and their versions (System - About)
  • Jira 1.1.0, Director 1.8.1
  • Web browser used: Vivaldi
  • Icinga 2 version used: 2.13.1-1

What do you see when you manually trigger a notification and look for the executed command in /var/log/icinga2/icinga2.log?

IIRC it will only tell you the command executed (with arguments), not if it was successful or not. Copy the command and args, run it manually, and see if there is an error.

If I trigger the notification through Icingaweb I get the following entry in the log files.

[2021-09-17 12:04:37 +0200] information/ExternalCommandListener: Executing external command: [1631873077] SEND_CUSTOM_SVC_NOTIFICATION;test;Windows RAM;0;test
[2021-09-17 12:04:37 +0200] information/Checkable: Checkable 'test!Windows RAM' has 2 notification(s). Checking filters for type 'Custom', sends will be logged.

If I trigger jira module through icingacli the ticket in Jira is created

icingacli jira send problem --project ITS --issuetype Incident -summary test --description icinga test --state DOWN --host test

I’ve gone through the logs and found other entrys related to the notifications:

[2021-09-17 15:46:05 +0200] information/Notification: Sending reminder 'Problem' notification 'test!Host (Ticket)' for user 'jira'
[2021-09-17 15:46:05 +0200] information/Notification: Completed sending 'Problem' notification 'test!Host (Ticket)' for checkable 'test' and user 'jira' using command 'JIRA Host Notification'.

It looks like the notifications are sent by Icinga. However, a ticket is still not created.

Opps, maybe you need to enable the debug log to see the executed command in full.

There’s a disconnect somewhere – the command likely isn’t executing with the arguments or path that you think it is.

After I activated the debug mode, I could see the following error message in the log.

[2021-09-20 09:15:59 +0200] warning/PluginNotificationTask: Notification command for object 'test!Windows-IcingaCheckService' (PID: -1, arguments: 'sh' '-c' '') terminated with exit code 3, output: Error: Non-optional macro 'jira_issuetype' used in argument '--issuetype' is missing.

I have now created a field above the Director and set the Jira project as the default value. Now the automatic creation of tickets works.

Thanks a lot for your help Ben.

2 Likes