Icinga is an open source computer system and network monitoring application. It was originally created as a fork of the Nagios system monitoring application in 2009.
Icinga is attempting to get past perceived short-comings in Nagios’ development process, as well as adding new features such as a modern Web 2.0 style user interface, additional database connectors (for MySQL, Oracle, and PostgreSQL), and a REST API that lets administrators integrate numerous extensions without complicated modification of the Icinga core.
This tutorial will cover how you can install Icenga Core, and Icenga Web interface, and we are going to explain how is that step by step, but first make sure that you already installed LAMP, if still not, you can head to install it from HERE.
1. Open “Terminal”, and download Icinga package and it’s key by the command below.
curl -sSL https://packages.icinga.com/icinga.key | sudo apt-key add –
2. Now we have to add Icinga to the repository of our configuration file, do that through “nano” editor by the command below, it will open a blank file.
sudo nano /etc/apt/sources.list.d/icinga.list
3. Copy-Paste the below and save & exit.
deb https://packages.icinga.com/ubuntu icinga-xenial main
4. Refresh your package cache, by running this command “sudo apt-get update“.
5. Time to install Icinga, we can perform this action by the below command.
sudo apt-get install icinga2 icinga2-ido-mysql
type ‘Y’ and press Enter to continue.
6. The installation process will start to ask some questions please answer like the screenshots below.
– “Enable Icinga 2’s ido-mysql feature?” “YES”.
– “Configure database for icinga2-ido-mysql with dbconfig-common?” “YES”.
– Setup database password like below screenshot, make sure to make it a Complex password.
7. After the installation finish, run the below command to restart Icinga.
“sudo systemctl restart icinga2″
8. Check the current status of Icinga2, by the below command.
sudo systemctl status icinga2
Now Icinga is successfully installed, let’s move to the second phase of our tutorial and install Icinga web interface.
Install Icinga Web Interface
1. Install Icinga-web, by the below command on “Terminal”.
sudo apt-get install icingaweb2
Type “Y” and press Enter to continue.
2. The rest of the installation process of Icinga can be done through the web browser, but first, we need set the timezone to avoid errors with PHP environment, do that by opening nano editor by the below command.
sudo nano /etc/php/7.0/apache2/php.ini
3. We need to edit specific line, Hold ‘Ctrl + W” and search for “Date.Timezone”, and then remove the initial semi-colon “;“, and then write your correct time zone.
Save and then close the file.
4. Restart Apache server to get the update changes, by the below command.
sudo systemctl restart apache2
5. Before we open our web browser to continue the installation of Icinga web2, we have to create a token for it, we can do this through the below command.
sudo icingacli setup token create
Copy the token as we will use it later.
6. Open your web browser and go to Icinga web by typing your local IP address or your domain name following by “/icingaweb2”.
7. Paste the token number that we had copied from “Terminal”, and paste it and press Next.
8. After you click “Next”, the wizard will prompt you option to install extra modules, we can simply satisfy with the Monitoring module, and click Next to continue.
9. On the third screen, the wizard will display some requirements such as green boxes, just make sure that there are no “RED BOXES” as that will get us a miss configuration, it’s ok to see yellow boxes just ignore it and click Next.
10. Choose the authentication method, leave it as default “Database”.
11. Now on the below screenshot, we need to enter the connection details of “IDO-SQL” database, that we already created its password during the installation, and click “Validate Configuration” to make sure that everything is correct.
12. ِAfter you set all the required data from the installation process you can simply log in to your Icinga web, by typing your IP following it by “/icingaweb2”.
After this tutorial you have successfully set up Icinga2 and Icinga Web2, Currently, we are only monitoring the Icinga host itself though.