LinuxLinux MintTutorials

How To Install Icinga on Linux Mint 20

Install Icinga on Linux Mint 20

In this tutorial, we will show you how to install Icinga on Linux Mint 20. For those of you who didn’t know, 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.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you the step-by-step installation of the Icinga 2 monitoring tool on a Linux Mint 20 (Ulyana).

Prerequisites

  • A server running one of the following operating systems: Linux Mint 20 (Ulyana).
  • It’s recommended that you use a fresh OS install to prevent any potential issues.
  • A non-root sudo user or access to the root user. We recommend acting as a non-root sudo user, however, as you can harm your system if you’re not careful when acting as the root.

Install Icinga on Linux Mint 20 Ulyana

Step 1. Before running the tutorial below, it’s important to make sure your system is up to date by running the following apt commands in the terminal:

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

Step 2. Installing a LAMP server.

A Linux Mint LAMP server is required. If you do not have LAMP installed, you can follow our guide here.

Step 3. Installing Icinga on Linux Mint 20.

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

Step 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

Install Icinga on Linux Mint 20 Ulyana

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

Install Icinga on Linux Mint 20 Ulyana

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

Step 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: 46e3cgdt120d83

Step 6. Accessing 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.

Install Icinga on Linux Mint 20 Ulyana

Congratulations! You have successfully installed Icinga. Thanks for using this tutorial for installing the latest version of the Icinga 2 monitoring application on the Linux Mint system. For additional help or useful information, we recommend you check the official Icinga website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is an experienced Linux enthusiast and technical writer with a passion for open-source software. With years of hands-on experience in various Linux distributions, r00t has developed a deep understanding of the Linux ecosystem and its powerful tools. He holds certifications in SCE and has contributed to several open-source projects. r00t is dedicated to sharing her knowledge and expertise through well-researched and informative articles, helping others navigate the world of Linux with confidence.
Back to top button