Icinga is an open source monitoring tool originally based on Nagios. Icinga2 has been completely rewritten from scratch. The web interface is very fast and is capable of monitoring many different services from simple ping tests to database tests. I only need to monitor relatively simple things like HTTPS services and TCP ports. SNMP is relatively easy to set up with Icinga so I’ll monitor important hosts with it as well (local switches and routers). Icinga will poll the configured hosts but it will not produce graphs. It will, however, warn you if a check is at the set “warning” level or “critical” level. These settings can be changed on a per service basis. It can be very useful in this regard - easily finding issues or outages with your servers.
Add the Icinga2 repository.
- 123wget -O - http://packages.icinga.org/icinga.key | apt-key add -echo 'deb http://packages.icinga.org/debian icinga-jessie main' >/etc/apt/sources.list.d/icinga.listapt-get update
apt-get install icinga2
Install Nagios plugins.
apt-get install nagios-plugins nagios-snmp-plugins
Install and configure MySQL. This needs to be done before installing Icinga web otherwise you’ll end up with issues where Icinga is installed before MySQL.
apt-get install mysql-server mysql-client
mysql -u root -p
CREATE DATABASE icingaweb2;
GRANT SELECT, INSERT, UPDATE, DELETE, DROP, CREATE VIEW, INDEX, EXECUTE ON icingaweb2.* TO 'icingaweb2'@'localhost' IDENTIFIED BY 'icingaweb2';
Install the web interface.
apt-get install icingaweb2
Install the Icinga IDO plugin.
apt-get install icinga2-ido-mysql
icinga2 feature enable ido-mysql
systemctl restart icinga2
Configure the web interface.
icingacli setup token create
- For the IDO database set it to
Congratulations! The Icinga2 web interface is now up and running.
apt-get install snmpd snmp-mibs-downloader
Next, edit the SNMPd config and add a user.
- 12createUser <username> SHA <secure password> AESrouser <username> priv
- Comment out
For SNMPv2c you can just add/uncomment (no encryption, useful for local monitoring because it’s easier):
rocommunity public default
systemctl restart snmpd.service
You can test SNMPv3 by using this command:
Simple host definition for SNMPv2c:
The above definition will configure Icinga to do a simple ping check, and then because the host OS is set to “Linux” it will also do an SSH check.
Simple interface check via SNMP:
TCP connect monitoring:
nut to be installed.
HTTPS service monitoring:
This command will not work with only SNMPv3.