Having Issues with Jira Configuration in Icinga

Need your assistance in configuring Jira in Icinga.

Give as much information as you can, e.g.

  • Icinga Web 2 version : 2.7.3
  • Used modules and their versions (System - About) :
  • Web browser used : Google Chrome
  • Icinga 2 version used (icinga2 --version) : 2.11.3-1
  • PHP version used (php --version) : 7.1.30
  • Server operating system and version : RHEL 7

Hi,

well, that is not much (i.e. none) information you are providing here regarding your issues.
Where are you stuck exactly?
Have you read through the documentation?

Hi @log1c,

Thank you for documents you shared. We were able to configure Jira in our Icinga server. Could you Please also guide us how to create automated Jira Issues when one of our services threshold is reached?

Regards,
Nikesh Singh B.

Well, the link to the documentation walks you through everything you need to implement the module and configure the basics (apart from the notification apply rules for (single) hosts and services).

Start here: icingaweb2-module-jira/03-Configuration.md at master · Icinga/icingaweb2-module-jira · GitHub
As you said that you already have installed the module to Icinga Web 2 the next step would be the configuration of the module to have the connection to JIRA configured

Next you need to create to fields in JIRA for the notifications from icinga

When this is done you should already be able to send notifications from the cli

If that works, configure the notification commands
If you are using the Icinga Director you can let the module do that automatically

After this create notification templates using the new commands, configure for what states and types the notifications should be sent.
I suggest

  • hosts
    – states “up, down”
    – types “problem, recovery”
  • services
    – states “ok, warn, crit, unknown”
    – types “problem, recovery”

and then filter on the user level which notification is to be really sent to the users.
Last step is to configure notification apply rules for one or more hosts/services.

Would you say that the documentation is not clear enough?
I’m always happy to hear suggestions for improvements :slight_smile:

Hi @log1c ,

Below is host configuration file.

object Host "jira.com" {
  import "generic-host"
  vars.os = "linux"
  address = "ip-address.x.x.x"
  check_command = "hostalive"
  vars.agent = "ssh"
  vars.mountpoint = "/app"
  vars.user = "icinga"
vars.notification["mail"]   = { groups = [ "icingaadmins" ] }
vars.notification["jira"]   = { groups = [ "icingaadmins" ] }
}

Done configuration into notification.conf as below.

apply Notification "jira" to Host {
  import "jira-host-notification"
  user_groups = host.vars.notification.jira.groups
  users = host.vars.notification.jira.users
  assign where host.vars.notification.jira
}
apply Notification "jira" to Service {
  import "jira-service-notification"
  user_groups = host.vars.notification.jira.groups
  users = host.vars.notification.jira.users
  assign where host.vars.notification.jira
}

Done Configuration into template.conf as below

object NotificationCommand "jira-host-notification" {
    import "plugin-notification-command"
    command = [ "/usr/bin/icingacli", "jira", "send", "problem" ]
    arguments += {

        "--description" = {
            description = "JIRA issue description"
            required = true
            value = "$jira_description$"
        }
        "--host" = "$host.name$"
        "--issuetype" = {
            description = "JIRA issue type (e.g. Incident)"
            required = true
            value = "$jira_issuetype$"
        }
        "--no-acknowledge" = {
            description = "D not acknowledge  Icinga problems once a JIRA issue got created"
            value = "$jira_no_acknowledge$"
        }
        "--project" = {
            description = "JIRA project name (e.g. ITSM)"
            required = true
            value = "$jira_project$"
        }
        "--service" = "$service.name$"
        "--state" = {
            description = "Service state (e.g. CRITICAL)"
            value = "$service.state$"
        }
        "--summary" = {
            description = "JIRA issue summary"
            required = true
            value = "$jira_summary$"
        }
        "--template" = {
            description = "Issue template name (templates.ini section). This allows to pass custom fields to JIRA"
            value = "$jira_template$"
        }
    }
    vars.jira_description = "$service.output$"
    vars.jira_summary = "$service.name$ on $host.name$ is $service.state$"
}

jira-service-notification

object NotificationCommand “jira-host-notification” {
import “plugin-notification-command”
command = [ “/usr/bin/icingacli”, “jira”, “send”, “problem” ]
arguments += {
“–description” = {
description = “JIRA issue description”
required = true
value = “$jira_description$”
}
“–host” = “$host.name$”
“–issuetype” = {
description = “JIRA issue type (e.g. Incident)”
required = true
value = “$jira_issuetype$”
}
“–no-acknowledge” = {
description = “D not acknowledge Icinga problems once a JIRA issue got created”
value = “$jira_no_acknowledge$”
}
“–project” = {
description = “JIRA project name (e.g. ITSM)”
required = true
value = “$jira_project$”
}
“–state” = {
description = “Host state (e.g. DOWN)”
value = “$host.state$”
}
“–summary” = {
description = “JIRA issue summary”
required = true
value = “$jira_summary$”
}
“–template” = {
description = “Issue template name (templates.ini section). This allows to pass custom fields to JIRA”
value = “$jira_template$”
}
}
vars.jira_description = “$host.output$”
vars.jira_summary = “$host.name$ is $host.state$”
}

“diskchecksun”
“mail-service-notification”

check_command = “jira-host-notification”
check_command = “jira-service-notification”

Could you Please help with next steps as Jira tickets are not getting created with these steps?

Regards,
Nikesh.

this does not fit. For service notifications you will need the jira-service-notification command not the jira-host-notification command.
Fix this and then check again if it works.
Also check the icinga2.log at /var/log/icinga2 and look what gets written there when you expect the notification to be sent.

1 Like

Hi @log1c,

Thank you for your support! Issue is fixed now.

You can go ahead and close this ticket.

good to hear :slight_smile:

But:
This is not a ticket system but a community forum :wink:

Please choose one of my answers as solution, so the thread is marked as “solved”.
https://community.icinga.com/faq#solution

1 Like

Hi @log1c,

I have marked a solution. Now this thread can be marked as solved.

1 Like