In this tutorial, we are going to explain in step-by-step detail how to install Icinga 2 on Ubuntu 22.04
Icinga is a free and open-source monitoring tool used for sending alerts when failures occur on the servers. Icinga is written in C++ and PHP and stores the information in the MySQL database. It offers many features, such as modern user interface database connectors for MySQL, PostgreSQL, Oracle, REST API, etc. In this blog post, we will install Icinga 2 with the LAMP stack.
Installing Icinga 2 with LAMP stack is a process that may take up to 30 minutes. Let’s get started!
root@host:~# sudo systemctl status icinga2
● icinga2.service - Icinga host/service/network monitoring system
Loaded: loaded (/lib/systemd/system/icinga2.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/icinga2.service.d
└─limits.conf
Active: active (running) since Sat 2023-04-22 19:06:11 CDT; 4min 35s ago
Main PID: 11632 (icinga2)
Status: "Startup finished."
Tasks: 16
Memory: 14.3M
CPU: 435ms
CGroup: /system.slice/icinga2.service
Step 4. Install the Icinga2 IDO Module
To install the Icinga2 IDO module, execute the following command:
Sponsored
sudo apt install icinga2-ido-mysql -y
While installing, choose Yes on both windows. It is about Icinga2 using MySQL.
After this, we need to create an icinga2-ido-mysql database with the following commands:
CREATE DATABASE icinga_ido_db;
GRANT ALL ON icinga_ido_db.* TO 'icinga_ido_db'@'localhost' IDENTIFIED BY 'YourStrongPasswordHere';
FLUSH PRIVILEGES;
EXIT;
Once the database is created, import the Icinga2 IDO schema with the following command:
sudo mysql -u root -p icinga_ido_db
Once the schema is imported, the next is to enable the Icinga2 IDO module:
Save the file, close it and enable the Icinga2-ido-mysql with the following command:
sudo icinga2 feature enable ido-mysql
After this restart the Icinga2 service:
systemctl restart icinga2
Step 5. Install and Setup IcingaWeb2
To install Icinga Web execute the following commands:
sudo apt install icingaweb2 icingacli -y
Next is to create a second database for the Icinga web:
CREATE DATABASE icingaweb2;
GRANT ALL ON icingaweb2.* TO 'icingaweb2'@'localhost' IDENTIFIED BY 'YourStrongPasswordHere';
FLUSH PRIVILEGES;
EXIT;
Next, we need to create an Icinga token:
root@host:~# sudo icingacli setup token create
The newly generated setup token is: dd3a1a8b218be0db
That was all with installing Icinga via the command line. The last step is about finishing the Icinga installation.
Step 6. Finish Icinga Installation
To finish the Icinga installation, you need to access it at http://YourServerIPaddress/icingaweb2/setup.
Enter the token, and follow the pictures if you want to finish the installation:
Set Administrative user and password:
The last is to set up Icinga2 IDO credentials you set before in Step 4.
Congratulations! You successfully installed and configured Icinga2 on Ubuntu 22.04. If you find any difficulties with installing Icinga 2, you can always contact our technical support. All you have to do is to sign up for one of our NVMe VPS plans and submit a support ticket. We are available 24/7.
If you liked this post about installing Icinga2 on Ubuntu 22.04, please share it with your friends on social networks or simply leave a reply below.