Lamp Based Nagios (Deprecated)

Opsgenie's Nagios integration plugin utilizes full capabilities of Opsgenie and provides bi-directional integration with Nagios. Integration leverages Opsgenie lamp and Marid utilities to automatically create rich alerts (status, alert histogram, trends, etc.) and synchronizes alert status between Nagios and Opsgenie.

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.

749

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 ParametersDescriptionMandatory to fill
apiKeyCopy 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.nagiosServernagiosServer 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 via MaridOptional
nagios.attachFilesIf enabled, lamp can attached histogram and trend images to alerts in Opsgenie. The default is enable.Optional
nagios.alert_histogram_image_urlLamp retrieves histogram images from Nagios using this URL. Localhost should be replaced with your nagios server address.Optional
nagios.trends_image_urlLamp retrieves trends images from Nagios using this URL. Localhost should be replaced with your nagios server address.Optional
nagios.command_urlURL to update Nagios alerts when alerts get acknowledged, commented, etc.Optional
nagios.userUsername to authenticate Nagios web server to get nagios histogram and trends images.Optional
nagios.passwordPassword to authenticate Nagios web server to get nagios histogram and trends images.Optional
nagios.http.timeoutTimeout 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

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

πŸ“˜

If you see any errors in logs, don't hesitate to contact us