Nagios Integration
The ilert Nagios Integration helps you to easily connect ilert with Nagios.
Last updated
The ilert Nagios Integration helps you to easily connect ilert with Nagios.
Last updated
(c) 2011 - 2024 ilert GmbH
Nagios is an open-source monitoring system that enables organizations to identify and resolve IT infrastructure problems before they affect critical business processes. It monitors the network for problems caused by overloaded data links or network connections, as well as monitoring routers, switches and more. Easily able to monitor the availability, uptime, and response time of every node on the network, Nagios can deliver the results in various visual representations and reports.
With the ilert Nagios Notification Plugin, you can easily integrate Nagios with ilert and extend your existing Nagios system (and other Nagios forks) with advanced alerting by SMS, phone calls, and push notifications, as well as on-call schedules.
Nagios 2 (or higher)
Python >= 3.7 (alternatively Python >= 2.7.9, we suggest 2.7.10)
Python 2.x is EOL (end of life) we suggest to use Python >= 3.7
Go to Alert sources --> Alert sources and click on Create new alert source
Search for Nagios in the search field, click on the Nagios tile and click on Next.
Give your alert source a name, optionally assign teams and click Next.
Select an escalation policy by creating a new one or assigning an existing one.
Select you Alert grouping preference and click Continue setup. You may click Do not group alerts for now and change it later.
The next page show additional settings such as customer alert templates or notification prioritiy. Click on Finish setup for now.
On the final page, an API key and / or webhook URL will be generated that you will need later in this guide.
Download the ilert Nagios plugin and unzip it:
Put the plugin file nagios_ilert.py
in the directory /usr/local/bin
. The file must be executable by both Nagios and the cron daemon:
In Nagios, enable the macro enable_environment_macros
(if not already active). Open your Nagios configuration file nagios.cfg
and set the value to 1:
If you have a larger Nagios installation and don't want to enable the macro enable_environment_macros
, see the ilert_nagios.cfg
configuration file for further information on how to this.
Open the plugin configuration file ilert_nagios.cfg
and enter the API key in the pager field of the contact definition, eg:
Copy the file into the Nagios configuration directory (varies depending on the Nagios installation).
Depending on the installation of Nagios, there is a nagios.cfg
file in which you must integrate the ilert configuration file. The entry in nagios.cfg
would look like this for this example:
Add the ilert contact to your Nagios contact group. If you are using the Nagios defaults, open the contacts.cfg
file for the ilert contact:
Edit the crontab file from the nagios user
Add the following entry:
Via this cron job, events are sent to ilert every minute that failed in the first send attempt (e.g. due to a network error).
Restart Nagios:
Which Nagios Notification Types are processed by the plugin?
The plugin processes the notification types PROBLEM
, ACKNOWLEDGEMENT
and RECOVERY
. The notification types FLAPPING*
and DOWNTIME*
are ignored.
What happens if my internet connection is interrupted? Are the events generated in Nagios lost?
No, events won't be lost. The plugin stores the events locally in a temporary directory (by default in /tmp/ilert_nagios) and tries to send them to ilert every minute. This means that as soon as your connection is available again, cached events will be sent to ilert.
The plugin does not work. What can I do?
First, please make sure that you have installed the correct Python version by using $ python --version
or $ python3 --version
(Python 2.7.9+ or Python 3.7+). Also take a look at the log. The plugin uses the Unix / Linux system log for logging (e.g. under /var/log/messages
or /var/log/syslog
). If you cannot find the error, please contact our support at support@ilert.com.
I received the following error: import urllib.request ImportError: No module named request.
This error message indicates that you are using the Python 3 script with Python 2. Please make sure that you are using the correct Python 2 script: