Install Icinga on Linux Mint 20 - Step by step guide ?

Install Icinga on Linux Mint 20 - Step by step guide ?

Icinga is an open-source computer system and network monitoring application. It is one of the most popular monitoring tools on the internet that provides high availability and distributed monitoring. Icinga 2 has a user-friendly web interface, but it also comes with a command-line interface that can be used for monitoring.

Here at Fixwebnode, as part of our Server Management Services, we regularly help our Customers to perform related open-source Software Installation queries.

In this context, we shall look into how to install Icinga on Linux Mint 20. 

 

Main features of Icinga 2 includes:

  • all standard features of Icinga and Nagios.
  • much faster and more scalable than Icinga 1 and Nagios.
  • new, more intuitive, template-based configuration format.
  • monitoring services on ICMP (ping) or TCP ports (HTTP, NNTP, POP3, SMTP, etc.) by executing checks (see monitoring-plugins*).
  • any small script following the Nagios plugin API can be used as a check plugin.
  • notifications about alerts for any custom script (with examples).
  • native support for Livestatus and Graphite.

 

Steps to Install Icinga on Linux Mint 20 Ulyana 

1. Perform System Update

To begin, to make sure your system is up to date by running the following apt command in the terminal:

$ sudo apt update

Also install system dependencies:

$ sudo apt install dirmngr gnupg apt-transport-https ca-certificates

 

2. Install a LAMP server

You can follow our guide to install LAMP server on Linux Mint.

 

3. Install Icinga on the system

By default, Icinga is not available on Linux Mint 20 base repository. Now we manually add the Icinga2 repository to your system with the following command:

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

Next, create the repository file for Icinga 2:

$ sudo nano /etc/apt/sources.list.d/icinga-focal.list

Add the following lines:

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

Finally, update the sources list and install it:

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

After installation is once done, start and enable the Icinga service:

$ sudo systemctl start icinga2
$ sudo systemctl enable icinga2

 

4. Configure MariaDB

First, we install this module because the IDO database is used as a backend by Icinga Web 2:

$ sudo apt install icinga2-ido-mysql

On the second window, you need to select "No" and hit Enter.

Next, we create a database and user for Icinga:

$ mysql -u root -p

This will prompt you for a password, so enter your MariaDB root password and hit Enter. Once you are logged in to your database server you need to create a database for Icinga 2 installation:

MariaDB [(none)]> create database icinga_db;
MariaDB [(none)]> grant all privileges on icinga2.* to icinga_db@localhost identified by 'strong-your-password';
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> exit;

After that, we import the IDO schema using the following command below:

$ sudo mysql -u root -p icinga_db < /usr/share/icinga2-ido-mysql/schema/mysql.sql

Then, enable the IDO MySQL Module:

$ sudo nano /etc/icinga2/features-available/ido-mysql.conf

Add the following configuration:

/**
* The db_ido_mysql library implements IDO functionality
* for MySQL.
*/
library "db_ido_mysql"
object IdoMysqlConnection "ido-mysql" {
user = "icinga2",
password = "your-strong-password",
host = "localhost",
database = "icinga_db"
}

Save and close the file, then restart the Icinga 2 service to apply all the configuration changes:

$ sudo icinga2 feature enable ido-mysql
$ sudo systemctl restart icinga2

 

5. Configure Icinga Web

Run the following command below to install the Icinga web:

$ sudo apt install icingaweb2 icingacli libapache2-mod-php

Next, we need to create a database manually:

$ sudo mysql -u root -p

Once you are logged in to your database server you need to create a database for Icinga Web:

MariaDB [(none)]> CREATE DATABASE icinga2web;
MariaDB [(none)]> GRANT ALL ON icinga2web.* TO 'icinga2web'@'localhost' IDENTIFIED BY 'your-strong-passwd';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT

After that, create a token that will be used in the next steps while configuring the web interface:

$ sudo icingacli setup token create

Output:

The newly generated setup token is: 65e3cgdt120d14

 

How to access Icinga 2 Web Interface ?

Once successfully installed, open your web browser and access the Icinga using the URL http://your-server-ip-address/icingaweb2/setup. You will be redirected to the welcome page of Icinga.

 

How To Uninstall icinga2 from Linux Mint 20 ?

To uninstall only the icinga2 package we can use the following command:

$ sudo apt-get remove icinga2

We can use the following command to remove icinga2 configurations, data and all of its dependencies, we can use the following command:

$ sudo apt-get -y autoremove --purge icinga2

 

[Need help in fixing Linux Mint system issues ? We can help you. ]

 


Conclusion

This article covers how to install the latest version of the Icinga 2 monitoring application on the Linux Mint system. In fact, Icinga2 is an open source tool for monitoring the IT resources.

 

How to Install icinga2 Using apt on Ubuntu Linux system ?

Update apt database with apt using the following command:

$ sudo apt update

After updating apt database, We can install icinga2 using apt by running the following command:

$ sudo apt -y install icinga2
 
In this guide, you will learn to add Linux machine to Icinga2 for monitoring. The default port that icinga2 uses for monitoring is 5665 & it should be opened up in firewall to maintain a connection between master & host (called parent & child for icinga2).

 


icon

Sign up to our Newsletter

...and get one free support ticket.