• Get started
  • Documentation

Integrate Opsgenie with Lamp Based Nagios (Deprecated)

Opsgenie’s Nagios plugin is the recommended integration method as it enables Nagios to take advantage of advanced capabilities provided by Opsgenie.

Installation

The steps below describe how to integrate Opsgenie and Nagios using Opsgenie’s Nagios integration plugin. Note that you may need to slightly alter these instructions depending on your exact Linux distribution and your Nagios configuration.

This document contains only specific instructions for deprecated Nagios integration. For other steps please refer to the new Nagios Integration's document.

Prerequisites

Packages are provided for Red Hat and Debian based Linux distributions.

Opsgenie Nagios Plugin is a java application, therefore, requires the Java Runtime version 1.6+ Both the Open JDK and Oracle JVMs can be used.

Ensure that JAVA_HOME environment variable is set. If it is not, you may set it by removing the comment at the beginning of the following line in /etc/opsgenie/profile file and set JAVA_HOME to your JRE installation directory.
#JAVA_HOME=<path/to/JDK or JRE/install>

Add Nagios Integration in Opsgenie

To add Nagios integration in Opsgenie, go to Opsgenie Nagios Integration page

Click on "Save Integration" button to save the integration. An "API Key" is generated for the integration. This key will be used by Nagios to authenticate with Opsgenie and specify the integration that should be used to process Nagios alerts.

Nagios integration

Opsgenie Plugin Configuration in Nagios

The plugin uses lamp (included in the plugin) to create, acknowledge and close alerts in Opsgenie. Lamp is a command line utility that interfaces with Opsgenie services via HTTPS. Lamp can be used to work with alerts, enable/disable policies and integrations, etc. Nagios is configured to use lamp to create, acknowledge and close alerts in Opsgenie.

Lamp configuration parameters can be found at /etc/opsgenie/conf/opsgenie-integration.conf file. Setting the apiKey parameter is required. Other configuration parameters are set to defaults that work with most Nagios implementations but may need to be modified as well.

Configuration Parameters

Description

Mandatory to fill

apiKey

Copy the API key from the Nagios integration you've created above. Lamp uses this key to authenticate to Opsgenie. API key is also used to identify the right integration configuration that should be used to process the alerts forwarded by lamp.

Yes

nagios.nagiosServer

nagiosServer field is used to identify the Nagios server in Opsgenie, and only required when there are multiple Nagios servers. This field is used by Opsgenie when sending actions executed by users (acknowledge, close, etc.) back to your Nagios servers.

Optional

nagios.attachFiles

If enabled, lamp can attached histogram and trend images to alerts in Opsgenie. The default is enable.

Optional

nagios.alert_histogram_image_url

Lamp retrieves histogram images from Nagios using this URL. Localhost should be replaced with your Nagios server address.

Optional

nagios.trends_image_url

Lamp retrieves trends images from Nagios using this URL. Localhost should be replaced with your Nagios server address.

Optional

nagios.command_url

URL to update Nagios alerts when alerts get acknowledged, commented, etc.

Optional

nagios.user

Username to authenticate Nagios web server to get Nagios histogram and trends images.

Optional

nagios.password

Password to authenticate Nagios web server to get Nagios histogram and trends images.

Optional

nagios.http.timeout

Timeout duration in msecs to get Nagios histogram and trends images.

Optional

Testing the Integration and Troubleshooting

If the integration works as expected, when a host or service state becomes down in Nagios, an alert will be created in Opsgenie. When the host or service comes back up, the alert in Opsgenie will get closed automatically as well.

Verify that lamp can access Opsgenie
Create a test alert in Opsgenie using lamp from the shell

Text

1 lamp createAlert --message "nagios test alert" --recipients nobody

Check whether the alert is created in Opsgenie. If not, check the logs for lamp utility in the /var/log/opsgenie/lamp directory for any error messages

If you see "JAVA_HOME not defined" error in opsgeniescripter or opsgeniescriptout logs, you should define it in /etc/opsgenie/profile shell script.

Verify Nagios is able to create alerts in Opsgenie
Check whether there are alert from Nagios in Opsgenie. If Nagios is generating alerts, but alerts are not being created in Opsgenie, check the logs for lamp utility in the /var/log/opsgenie/lamp directory for any error messages

If there are no logs, ensure that the Nagios user has permission to write to the /var/log/opsgenie/lamp directory.

Verify graphs are attached to the alerts
Plugin retrieves relevant graphs from the Nagios server via HTTP(S) and attaches them to the alert. If the alerts in Opsgenie do not include these graphs as attached files, it may be due to the plugin not able to access to the Nagios server. Check whether the specified URLs in the configuration file are correct. Check whether these files can be retrieved using curl, etc.

Check the logs for lamp utility in the /var/log/opsgenie/lamp directory for any error messages

 

Still need help?

The Atlassian Community is here for you.