22 C
Texas
angeloma
Senior Writer and partner

How to install Icinga2 on Debian 10?

This tutorial will help you install Icinga2 on Debian 10. We will also contribute to install Icingaweb to better visualize the monitoring.

Icinga is an open-source software based on nagios that allows monitoring computer systems and networks. It is widely known worldwide as one of the most complete and easy to use.

So today we are going to install it.

Install Icinga2 on Debian 10

1) Install LAMP on Debian 10

First of all, it is necessary to have a basic LAMP service. This is mainly because we are going to install Icingaweb.

- Advertisement -

How to install LAMP on Debian 10?

Once you have LAMP installed you have to configure the timezone in PHP. To do this execute the following command:

:~$ sudo nano /etc/php/7.3/apache2/php.ini

And set the timezone:

date.timezone = "America/Chicago"

Save the changes and close the file. Then restart apache to apply the changes.

~$ sudo systemctl restart apache2

Now we can continue.

2) Create a database for Icinga

Now it is necessary to create a new database for Icinga. In this sense, we will take the opportunity to create a new user as well.

We access the MariaDB console and start:

:~$ sudo mysql -u root -p
> CREATE DATABASE icingaweb;
> GRANT ALL PRIVILEGES ON icingaweb.* TO 'icingawebuser'@'localhost' IDENTIFIED BY 'icingawebpss';
> FLUSH PRIVILEGES;
> EXIT;
1.- Creating a new database for Icinga
1.- Creating a new database for Icinga

3) Installing Icinga2 on Debian 10 (I)

Now we can install Icinga2’s base system. This must be done before installing Icingaweb. So open your terminal and run the following:

:~$ sudo apt install icinga2 vim-icinga2 monitoring-plugins-basic monitoring-plugins-common icingacli icinga2-ido-mysql
2.- Installing Icinga on Debian 10
2.- Installing Icinga on Debian 10

During the installation, we will be shown some screens asking if we want to enable Icinga support for Ido-mysql. Say yes.

3.- Configuring ido mysql
3.- Configuring ido mysql

After that, you will have to configure the icinga2-ido-mysql package. Again, say yes.

4.- Configuring Icinga2
4.- Configuring Icinga2

Then, set the MariaDB password for icinga2-ido-mysql.

5.- Set the mariadb password for the icinga2-ido-mysql package
5.- Set the mariadb password for the icinga2-ido-mysql package

4) Install Icingaweb2 on Debian 10

Now we can install Icinigaweb2. To do this just use the following command:

:~$ sudo apt install icingaweb2
6.- Installing Icingaweb2
6.- Installing Icingaweb2

And so that there are no problems in the running of the application, it is necessary to create a group icingaweb2 and be added to www-data.

:~$ sudo addgroup --system icingaweb2
:~$ sudo usermod -a -G icingaweb2 www-data

Before continuing the installation from the web, it is necessary to generate a token that we need. To do this, use these commands:

:~$ sudo icingacli setup config directory --group icingaweb2
:~$ sudo icingacli setup token create
7.- Generating the main toke for icingaweb
7.- Generating the main toke for icingaweb

Finally, restart the apache and Icinga service.

:~$ sudo systemctl restart apache2 icinga2

Now, we can continue.

5) Icinga2 on Debian 10 (II)

Now we can begin to complete the installation of Icinga2. Open your web browser and go to http://your-server/icingaweb2/setup.

In this first screen you have to introduce the recently generated token:

8.- Installing Icinga2 on Debian 10
8.- Installing Icinga2 on Debian 10

After clicking on the button below, enable the required modules. I will leave it by default.

9.- Icinga2 modules
9.- Icinga2 modules

On the next screen, the server requirements will be checked. Then click on next.

10.- Server requirements
10.- Server requirements

After that, set the authentication type:

11.- Authentication type
11.- Authentication type

When you click on next, you will have to place the credentials of the database that we have previously created.

12.- Database credentials
12.- Database credentials

Then set the authentication backend.

13.- Authentication backend
13.- Authentication backend

Now create the admin user and your password.

14.- Creating the default user for icinga2 on Debian 10
14.- Creating the default user for icinga2 on Debian 10

Now, set the application configuration.

15.- Configuring Icinga2
15.- Configuring Icinga2

Now, you will see an installation summary. Just click on Next.

16.- Configuration summary
16.- Configuration summary

Now, configure the monitoring module.

17.- Configuring the monitoring module
17.- Configuring the monitoring module

Now, configure the monitoring backend.

18.- Monitoring backend
18.- Monitoring backend

Then, type the following credentials to configure the monitoring resources:

19.- Installing Icinga2 on debian 10
19.- Installing Icinga2 on debian 10

Now, the command transport.

20.- Command transport
20.- Command transport

After that, configure the monitoring security.

21.- Monitoring security
21.- Monitoring security

Finally, you can start the installation.

22.- Start the installation
22.- Start the installation

If everything went well, you will see a screen like this.

23.- Icinga2 on Debian 10
23.- Icinga2 on Debian 10

Now, you will see the log in page.

24.- Icinga log in page
24.- Icinga log in page

And you will see the dashboard.

25.- Icinga on Debian 10
25.- Icinga on Debian 10

So, enjoy it.

Conclusion

Now that you know how to install Icinga2 on Debian 10, you will be able to enjoy a pretty good tool to monitor networks and computers. This way it will be easier to administer the network and computers. While it is true that there are several steps, everything is worth with this great tool.

- Advertisement -
Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"

LEAVE A REPLY

Please enter your comment!
Please enter your name here



Latest article