Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Jira Service Management provides a rich bidirectional integration plugin for Nagios. Jira Service Management has a number of easy-to-use integration methods (email, API, command line tools, programming libraries, etc.) to ensure all monitoring tools are easily integrated with Jira Service Management. Nagios is integrated with Jira Service Management via the email interface , or by executing scripts in any language that uses Jira Service Management Web API. This document describes two supported integration options.

...

The Nagios plugin for Jira Service Management supports bidirectional integration with Nagios. The integration leverages Jira Service Management’s Nagios-specific executable and JEC utility to automatically create rich alerts (status, alert histogram, trends, etc.) and . It synchronizes alert status between Nagios and Jira Service Management. The Nagios plugin is the recommended integration method as it enables Nagios to take advantage of advanced capabilities provided by Jira Service Management.

...

  • When a host or service state becomes down in Nagios, an alert is created in Jira Service Management.

  • Upon creation of creating the new alert, related histogram and trends images from Nagios is are automatically attached to the alert automatically.

  • When the Jira Service Management alert is acknowledged, the alert in Nagios is also acknowledged automatically, and vice versa.

  • When a note is added to the Jira Service Management alert, the alert in Nagios is also updated automatically, and vice versa.

...

The Nagios integration plugin utilizes the full capabilities of Jira Service Management and provides bi-directional integration with Nagios. The steps in the following procedure describe how to integrate Jira Service Management and Nagios by using the Nagios integration plugin. Note that slight alteration to these instructions may be necessary depending on the exact Linux distribution and your Nagios configuration.

...

Install the Jira Service Management plugin for Nagios

Jira Edge Connector (abbreviated as JEC) is a prerequisite for configuring the outgoing authentication of Nagios integration. You can combinedly use JEC and Nagios scripts to update alerts on Nagios. With this setup, you can deploy your own script, modify the ones provided, or run customized actions on Nagios. Download the latest version of the Nagios package from this repository.

Expand
titleInstructions for RedHat-based distributions

Run the following command: 

rpm -i jsm-nagios-<your_version>.rpm

Before rpm upgrades, back up your configuration files.

The rpm package does not overwrite the existing configuration during upgrades. It saves the new default configuration file as integration.conf.rpmnew. To Add the-- force parameter to upgrade from version 201X-XX-XX to 2.X.X, add the --force parameter. For example: rpm -U --force jsm-nagios-<your_version>.rpm

Learn more about config file handling for rpm upgrades.

...

The plugin uses a golang-executable file (included in the plugin as send2jsm) to create, acknowledge, and close alerts in Jira Service Management. To make send2jsm work, you need to make some configurations. The following table lists the parameters and states if they are mandatory. Setting the apiKey is required. Other configuration parameters are set to their default values that work with most Nagios implementations but may also need to be modified as well.

Expand
titleConfiguration parameters

Configuration Parametersparameters

Description

Mandatory?

Location

apiKey

Copy the URL from the integration configuration page in Jira Service Management. send2jsm uses this key to authenticate to Jira Service Management. API key is also used to identify the right integration configuration that should be used to process alerts.

Yes

/home/jsm/jec/conf/jec-config.json

baseUrl

Change this field according to your Jira Service Management environment (For example: EU, sandbox)

No

/home/jsm/jec/conf/jec-config.json

teams

Teams that should be notified of the Nagios alerts. Use the field to set the default value. You can modify it to route alerts to different teams on the integration configuration page in Jira Service Management.

No

/home/jsm/jec/conf/integration.conf

tags

Tags of the alert that were created in Jira Service Management.

No

/home/jsm/jec/conf/integration.conf

nagios_server

The Nagios server in Jira Service Management and is only required when there are multiple Nagios servers exist. This is used by Jira Service Management when sending actions run by users (acknowledge, close, etc.) back to your Nagios servers via JEC.

No

/home/jsm/jec/conf/integration.conf

logPath

The full path to the log file. (Default: /var/log/jec/send2jsm.log)

No

/home/jsm/jec/conf/integration.conf

nagios2jsm.http.proxy.enabled

To enable or disable the external proxy configuration. Default: false

No

/home/jsm/jec/conf/integration.conf

nagios2jsm.http.proxy.host

Host of the proxy

No

/home/jsm/jec/conf/integration.conf

nagios2jsm.http.proxy.port

Port of the proxy

No

/home/jsm/jec/conf/integration.conf

nagios2jsm.http.proxy.scheme

The proxy connection protocol. It may be http or https, depending on your proxy servers. Default: http

No

/home/jsm/jec/conf/integration.conf

nagios2jsm.http.proxy.username

The username for proxy authentication

No

/home/jsm/jec/conf/integration.conf

nagios2jsm.http.proxy.password

The password for proxy authentication

No

/home/jsm/jec/conf/integration.conf

...

Expand
titleMethod 2: Configure by using Golang flags

Configure by entering flags to command in the jsm.cfg file. Use -apiKey flag for your apiKey and -ns flag for the nagios_server name. If you don't have multiple Nagios servers, you don't have to define the Nagios server. Using flags overwrites all the other configuration methods mentioned earlier.

Configure the apiKey from the jsm.cfg file as follows (in JSON format):

Code Block
define command {
    command_name    notify-host-by-jsm
    command_line    /home/jsm/jec/scripts/send2jsm -apiKey="apiKey1" -entityType=service ...
}

When apiKey is added to the cfg file, it overrides the apiKey in the integration.conf file.

To send additional custom arguments, add them after the flags. For example, customArgName1 customArgValue1 customArgName2 customArgValue2. Parse custom arguments by adding {{_payload.customArgName}} to wherever is needed in the input fields. To learn more about using raw parameters, see dynamic fields.

Expand
titleMethod 3: Configure from script

Configure apiKey and nagios_server from the send2jsm.go script. Build the script again and put the new executable into the /home/jsm/jec/scripts directory. Learn more about the location of the send2jsm.go and how to build a go script in the “Source and recompiling send2jsm” section in this article.

...

Expand
title1. Nagios alerts are not getting created in Jira Service Management

Run the following test command from the shell and check if a test alert is created in Jira Service Management: 

Code Block
/home/jsm/jec/scripts/send2jsm -entityType=host -t=PROBLEM -hs=DOWN -hn=test_host
  • If you get a "Trace/breakpoint trap" error, the send2jsm plugin isn't compatible with the server distribution. Rebuild send2jsm.go according to the specific server environment as described in the “Source and recompiling send2jsm” section in this article.

  • If the alert is created in Jira Service Management, the integration is configured correctly. Nagios is probably not notifying the Jira Service Management contact for alerts. Check your Nagios alert notifications log.

  • If the alert is not created in Jira Service Management, check the logs at /var/log/jec/send2jsm.log.
    Look for the following errors in the log file:

    • If you see "RestException[Could not authenticate.]" in the logs, Jira Service Management couldn't identify the API key. Check if the API key is set correctly per the steps outlined in the “Configure the Jira Service Management plugin in Nagios” section of this article.

    • If unsure of the problem, set the plugin's log level to debug and try again. Contact us and share the logs.

  • If there is no /var/log/jec/send2jsm.log file or there are no logs in it, check the following:

    1. Check if the Nagios user has permission to write to /var/log/jec directory. The installation package should automatically do this for you. If you face issues, run the following command: 
      chown -R nagios:jsm /var/log/jec

    2. Check the Nagios server logs at /opt/nagios/log/zeneventd.log. See if there are error logs regarding send2jsm. Contact us with the logs as if needed.

Set send2jsm plugin's log level to DEBUG

Set the send2jsm plugin's log level to DEBUG. Open the /home/jsm/jec/conf/integration.conffile and change the line send2jsm.logger=warning to nagios2jsm.logger=debug.

Expand
title2. The Nagios alert is not acknowledged when the alert is acknowledged in Jira Service Management

Check the alert logs.

  • If "Posted [Acknowledge] action to Nagios.." is not present in the log, Jira Service Management didn't send the Acknowledge action to Nagios. Check the integration configuration, it might not have a matching the alert action.

  • If only the "Posted [Acknowledge] action to Nagios.." log occurs followed by no related logs, it might mean JEC is having connection problems. Check the logs.

...

Explore integration actionsAdd integration rules

https://operations-help.atlassian.net/l/cp/LGQEmX9J