Icinga2 is a very robust, almost to much, monitoring system. After trying a few others LibreNMS, Zabbix, and a few others, I decided that icinga2 was the best one to work with for my purposes.
This will get a very simple one server setup going. Icinga2 farms can get a LOT bigger though. Luckily they scale pretty well.
For the mail command which is used in notifications.
Install the Icinga2 repo
You should now be able to see the installed features.
Enable external commands.
Install the monitoring plugins and restart icinga2.
The above steps get Icinga2 installed but it doesn’t have a web interface, so next we’ll install MariaDB and Icinga2web. Icinga2web uses MariaDB to store it’s configuration. Setting up the DB. For the last step, you are just locking down the mariadb instance a bit for better security.
Next we created the DB so open a SQL console.
You will want to change the password for the icinga user in the GRANT command below to something safe.
Import the DB schema
Enable the IDO Mysql module.
Install and setup the web server. Apache in this case.
Now we can install icingaweb2. You can omit php-ldap if you aren’t going to use ldap authentication.
Set the php timezone using your favorite text editor. /etc/php.ini
When running the setup icingaweb2 will do a http check that will fail unless an index.html exists. Then just restart apache.
You will still need to generate a token for the web setup though. To do so run:
The token will be needed for the web setup.
You should now be able to go to: http://yourIP/icingaweb2/setup
At this point you should have a working icinga2 and icingaweb2 setup. You can either start adding hosts and services via text files, or as I like to do, install Director. Director is wonderful and makes the whole icinga2 experience so much better. I’ll talk about it in the next post.