Basics
Integrations
Integration into Icinga2
Icinga 2 is an open source monitoring system which checks the availability of your network resources, notifies users of outages, and generates performance data for reporting. Scalable and extensible, Icinga 2 can monitor large, complex environments across multiple locations.
Preconditions
For this chapter you need to have:
- a working Icinga2 installation (if you don't, let us help you)
- at least one configured service (click here for help)
Installation
Download a configuration from our site into the directory /etc/icinga2/
.
E.g.:
ssh root@icinga2 root@icinga2:~# cd /etc/icinga2/ root@icinga2:/etc/icinga2# curl https://Escalert.io/static/downloads/escalert_icinga2.tgz root@icinga2:/etc/icinga2# tar xf escalert_icinga2.tgz
Then prepare a queue for storing messages to Escalert.io:
mkdir /var/spool/escalert chown nagios: /var/spool/escalert/ chmod 755 /var/spool/escalert/
Finally, you can enable a cron job to check, if messages have been queued for delivery:
root@icinga2:~# crontab -e
Enter the following line into the editor, save and quit:
# m h dom mon dow command * * * * * /etc/icinga2/scripts/__check_escalert_queue.sh
Congratulations! You have now finished the basic configuration and can now link your hosts and services from Icinga2 to your Escalert.io notification schemes!
Configuration
In order to enable notifications for a host in Icinga2, you need to add the following
configuration line to the host. E.g., this host can be found in the file hosts.conf
:
Note to take the API-Key from the appropriate service in your Escalert.io configuration.
object Host NodeName { import "generic-host" /* other stuff */ vars.escalert_api = "kmswlkjrqwfvs...." }
In order to enable a service with the power of Escalert.io, use the following notation in, e.g., services.conf
:
apply Service "SomeServiceName" { /* whatever */ vars.escalert_api = "ppseplipowgyrkx...." }
Remember to activate your changes by:
root@icinga2:~# service icinga2 checkconfig root@icinga2:~# service icinga2 restart