In this blog post we’ll show you how to get even more out of your monitoring by integrating Nagios with Pingdom.
Nagios is an open source computer system monitoring, network monitoring and infrastructure monitoring software application. Used by hundreds of thousands of users worldwide, Nagios monitors your entire IT infrastructure to ensure systems, applications, services, and business processes are functioning properly.
This tutorial can also be found on pingdom.com under our guides.
Getting started
We’re starting off in our control panel My Pingdom.
- Start by creating a new External Service ID. Under Monitoring > External Services click Add New.
- Enter a Name and an Alert Policy.
- Click Save.
- Once the service is created it appears in the list of services on the page. In this list you’ll see the Service ID which you’ll need when you configure your Nagios server to send events to Pingdom.
Setup
- Download nagios_config.cfg and pingdom_nagios.py:
- Place pingdom_nagios.py in a folder of your choice and make it executable i.e.
sudo mkdir -p /opt/pingdom sudo mv pingdom_nagios.py /opt/pingdom/ sudo chmod +x /opt/pingdom/pingdom_nagios.py
- Place pingdom_nagios.conf in a suitable configuration directory (depends on your Nagios/Icinga setup), Debian for instance uses /etc/nagios3/conf.d/ by default, and make sure it’s readable.
sudo mv pingdom_nagios.conf /etc/nagios3/conf.d/ sudo chown nagios:nagios /etc/nagios3/conf.d/pingdom_nagios.conf sudo chmod 660 /etc/nagios3/conf.d/pingdom_nagios.conf
- Open pingdom_nagios.conf in the editor of your choice.
- Replace PINGDOM_SERVICE_ID with your own Service ID created in step 4 above.
- Adjust the path in the command section to match where you placed pingdom_nagios.py (if you put it in /opt/pingdom you’re ok).
- Add the contact “pingdom” to your Nagios’ configuration main contact group. By default configuration, open /etc/nagios3/conf.d/contacts_nagios2.cfg and look for the “admins” contact group. Then, simply add the “pingdom” contact.
- If not already present, please add the following to the main nagios.cfg (/etc/nagios3/nagios.cfg):
enable_environment_macros=1
- Restart Nagios.
sudo service nagios3 restart
- Add the following to /etc/crontab, and again, adjust the path if you put the file elsewhere and verify that the user below is the same that your Nagios installation uses.
* * * * * nagios /opt/pingdom/pingdom_nagios.py --send