Integrate with Nagios
Overview
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.
This article explains integrating Jira Service Management with Nagios. If you’re using Nagios XI, go to Integrate with Nagios XI.
What does the integration offer?
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.). 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.
How does the integration work?
When a host or service state becomes down in Nagios, an alert is created in Jira Service Management.
Upon creating the new alert, related histogram and trends images from Nagios are automatically attached to the alert.
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.
Set up the integration
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 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.
Installation prerequisites
The installation packages support the following systems:
RedHat-based Linux distributions
Debian-based Linux distributions
Install the Jira Service Management plugin for Nagios
Jira Edge Connector (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.
Add Nagios integration
If you're using the Free or Standard plan in Jira Service Management. To access the feature through Settings
(gear icon) > Products
(under JIRA SETTINGS) > OPERATIONS
, you need to be on Premium or Enterprise plan.
Adding an integration from your team’s operations page makes your team the owner of the integration. This means Jira Service Management only assigns the alerts received through this integration to your team.
To add a Nagios integration in Jira Service Management:
Go to your team’s operations page.
On the left navigation panel, select Integrations and then Add integration.
Run a search and select “Nagios”.
On the next screen, enter a name for the integration.
Optional: Select a team in Assignee team if you want a specific team to receive alerts from the integration.
Select Continue.
The integration is saved at this point.Expand the Steps to configure the integration section and copy the URL.
You will use this URL while configuring the integration in Nagios later.Select Turn on integration.
The rules you create for the integration will work only if you turn on the integration.
Configure the Jira Service Management plugin in Nagios
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.
Configure the golang-executable file in any of the following three methods:
Define Nagios contacts
1. Copy the /home/jsm/jec/jsm-nagios/jsm.cfg file (configures a contact, its host, and service notification commands) in to /usr/local/nagios/etc/objects directory.
2. Add the following line to the main Nagios configuration file (NAGIOS_HOME/etc/nagios.cfg):
3. Add the contact “jsm" to the Nagios configuration’s main contact group in NAGIOS_HOME/etc/objects/contacts.cfg file. If using the default configuration contacts.cfg, add "jsm" user to the "admins" contact group.
4. Restart Nagios.
If everything goes well, alerts are seen in Jira Service Management for every notification created in Nagios.
Configure Jira Service Management to update Nagios
This is an optional step.
Select the Send Alert Actions To Nagios checkbox on the integration configuration page. 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.
To run actions in Nagios, JEC gets the configuration parameters from the configuration file, config.json (found at /home/jsm/jec/conf/jec-config.json).
The downloaded package includes the JEC utility (found in /usr/local/bin) and the script that JEC needs to run (found in /home/jsm/jec/scripts). Be sure to run JEC after configuring it. Learn more about running JEC documentation. If using JEC, rich alerts are populated with host or service current status information in Jira Service Management for every notification created in Nagios.
The Nagios integration package does not support SSL v1.0. If your Nagios Server has SSL v1.0, upgrade your SSL server.
Source and recompiling send2jsm
The source for the executable send2jsm is found in /usr/bin/ and send2jsm.go, in /home/jsm/jec/scripts respectively and is also available in this repository. To change the behavior of the executable, edit send2jsm.go and build it by using the following command: go build send2jsm.go
For installing go, refer to http://golang.org/doc/install. Note that the executable in the plugin is built for linux/amd64 systems.
FAQ and troubleshooting
If the integration is not working, review this section and follow the prescribed guidelines.