Install Icinga on Ubuntu 20.04 LTS - step by step process ?

Icinga 2 is an open-source network monitoring system which checks the availability of your network resources, notifies users of outages, and generates performance data for reporting. It's Scalable and extensible, Icinga2 can monitor large, complex environments across multiple locations.

Here at LinuxAPT, as part of our Server Management Services, we regularly help our Customers to perform related Linux system network monitoring queries.

In this context, we shall look into how to install Icinga on Ubuntu 20.04 LTS.


Main features of Icinga includes:

  • Different types of logging: File logging, Syslog and Console logging
  • External command pipe for processing commands triggering specific actions
  • Performance data
  • Clear-cut, object-based configuration
  • Dynamic notifications
  • Elasticsearch Writer


Steps to Install and configure Icinga on Ubuntu 20.04 LTS Focal Fossa 

1. Perform System Update

First, make sure that all your system packages are up-to-date by running these following apt commands in the terminal:

$ sudo apt update
$ sudo apt upgrade


2. Install LAMP stack

Here, a LAMP server is required. If you do not have a LAMP installed, you can follow our guide here.


3. Install Icinga on the system

Now we install the icinga2 packages and Nagios Monitoring plugins. First, add the GPG key of the Icinga2 to your system:

$ curl https://packages.icinga.com/icinga.key | apt-key add -

Next, create a new repository file 'icinga-focal.list':

$ nano icinga-focal.list

Add the following repository configuration:

deb http://packages.icinga.com/ubuntu icinga-focal main
deb-src http://packages.icinga.com/ubuntu icinga-focal main

Then, run an update of the package list and install Icinga packages:

$ sudo apt update
$ sudo apt install icinga2 monitoring-plugins

Once the installation is completed, start the Icinga2 service and add it to the system boot:

$ sudo systemctl start icinga2
$ sudo systemctl enable icinga2


4. Configure the Database Server

We will install the icinga2 module for the MySQL support named 'icinga2-ido-mysql'.

$ sudo apt install icinga2-ido-mysql

Next, to make the Icinga works with the new MySQL/MariaDB version, we will configure the MySQL user 'icinga2' with the MySQL native password authentication:

$ mysql -u root -p

After that, change the authentication of user 'icinga2@localhost' with the native MySQL authentication plugin using the following query:

ALTER USER icinga2@localhost IDENTIFIED WITH mysql_native_password BY 'your-strong-passwd';
flush privileges;

Next, enable the 'ido-mysql' feature and check all enabled plugins:

icinga2 feature enable ido-mysql
icinga2 feature list

Then restart Icinga for the changes to take effect:

$ sudo systemctl restart icinga2


5. Install Icinga Web

Icinga Web 2 is a powerful PHP framework that provides a web management interface for Icinga. Now we Install icingaweb2 and icingacli packages using the following command:

$ sudo apt install icingaweb2 icingacli

Next, generate the icingaweb2 token for the installation:

$ icingacli setup token create

You'll see the similar output:

icingacli setup token create

The newly generated setup token is: e00b7kimpoi690700

Next, log in to the MySQL shell using the MySQL command below:

$ mysql -u root -p

Create a new database and user using the following queries:

create database icingaweb2;
create user icingaweb2@localhost identified with mysql_native_password by "your-strong-passwd";
grant all privileges on icingaweb2.* to icingaweb2@localhost with grant option;
flush privileges;


How to access Icinga 2 Web Interface ?

Icinga2 will be available on HTTP port 80 by default. 

Open your favorite browser and navigate to http://your-domain.com/icingaweb2/setup or http://server-ip-address/icingaweb2/setup and complete the required steps to finish the installation. 

If you are using a firewall, please open port 80 to enable access to the control panel.


[Need help in installing any Software ? We can help you. ]

This article covers the process of installing Icinga 2 on your Ubuntu LTS system. Infact, Icinga is a computer system and network monitoring application that checks the availability of your network and computer resources, notifies system outages, generates performance data of your resources, and provides the high-availability and distributed monitoring setup with the built-in cluster feature. 

Related Posts