Search This Blog

How to install Icinga Web 2 on CentOS 8

Icinga Web 2 is a web-based application that comes along with Icinga2. In this post, we show how to install Icinga Web 2 on CentOS 8.

Install icinga2 web2

After we installed the icinga2 successfully, we need to install the Icinga Web 2, Web interface of Icinga2.

Install PHP and PHP Extensions

Install the PHP extension required by the Icinga Web2 with the below command.

dnf install -y php php-json php-xml php-intl php-common php-pdo php-mysqlnd php-cli php-mbstring php-fpm php-gd php-zip php-ldap

Install Icinga Web 2

To install the Icinga Web 2 package along with Icinga CLI and Apache web service.

dnf install -y icingaweb2 icingacli httpd

Start the Apache web server and PHP FPM, and enable it to start when the server boot.

systemctl start httpd
systemctl start php-fpm
systemctl enable httpd
systemctl enable php-fpm

Create a database for Icinga web 2

Login into MariaDB sever. Please take note of this database information, we will use it when setting up Icinga Web 2.

CREATE DATABASE icingaweb2db;
grant all privileges on icingaweb2db.* to icingaweb2@localhost identified by 'icinga123';
quit;

SELinux

dnf install -y icingaweb2-selinux

Firewall

firewall-cmd --permanent --add-service=http
firewall-cmd --reload

Setup Icinga Web 2

icingacli setup token create

The newly generated setup token is: 500ee69ca39cfb89

Conclusion
Icinga Web 2 is a web-based application used as Icinga2 GUI for viewing the device status, service status, etc. You may also like:

How to install Icinga2 on CentOS 8

How to install Icinga2 on CentOS 8

Icinga is a monitoring system that checks the availabilities of network resources, notifies the user of any outages events. In this post, we are going to show, how to install Icinga2 and Icinga Web2 on

Enable EPEL Repository

The Icinga packages for CentOS 8 depend on other packages that are in the REPEL repository. CentOS 8 need the PowerTools repository for EPEL:

dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
dnf config-manager --set-enabled PowerTools

Add Icinga Repository

Icinga provides the dedicated repositories, so we need to enable its repository.

rpm --import https://packages.icinga.com/icinga.key
dnf install -y https://packages.icinga.com/epel/icinga-rpm-release-8-latest.noarch.rpm

Install Icinga 2

We can install icinga2 using our package manager DNF to install the icinga2 package.

dnf install -y icinga2

Restart service and enable icinga2 service to start automatically when the system boot.

systemctl start icinga2
systemctl enable icinga2

SELinux

Icinga 2 provides its own SELinux policy name icinga2-SELinux, so install it.

dnf install -y icinga2-selinux

Intall Nagios Plugins

Icinga2 would be able to monitor the network, application and service depend on the plugins. Icinga2 uses Nagios plugins as its plugins to monitor. The Nagios plugins are available in the EPEL repository, so we can install it now.

dnf install -y nagios-plugins-all

Firewalld

Allow port 5665 in our firewall rule.

firewall-cmd --permanent --add-port=5665/tcp
firewall-cmd --reload

Configuring DB IDO MySQL

The DB IDO help icinga2 to export all of its configuration and status information to the database. We are going to use MariaDB as our database server.

Install Database Server

dnf install -y mariadb-server mariadb

Restart and Enable MariaDB service to start up when system boot.
systemctl restart mariadb
systemctl enable mariadb

Install IDO modules for MySQL

Now, install the icinga2-ido-mysql module to help icinga2 to communicate with MariaDB.

dnf install -y icinga2-ido-mysql

Create a Database for IDO modules

By default, no password requires for the root user to login to the MariaDB database. To secure, mysqladmin -u root password YOURPASSWORD.
Create a database and database username and password. Please take note of this database information, we will need it when setting up the web interface.

mysql -u root -p

create database icinga2;
grant all privileges on icinga2.* to icinga2@localhost identified by 'icinga123';
flush privileges;
quit

Now import the Icinga 2 IDO schema into our database just created at the moment by running the following commands.

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

Enable IDO MySQL Module

The ido-mysql is disabled by default. Use the command below to verify the enabled and available module in icinga2.

icinga2 feature list

Type the below command to enable ido-mysql module for Icinga2.

icinga2 feature enable ido-mysql

Enable command feature for Icinga2.

icinga2 feature enable command

Configure the IDO DB MySQL module

After we have enabled the IDO module, edit /etc/icinga2/features-enabled/ido-mysql.conf file and make change the database information accordingly.

vi /etc/icinga2/features-enabled/ido-mysql.conf

user = "icinga2",
password = "icinga123",
host = "localhost",
database = "icinga2"

systemctl restart mariadb icinga2

Conclusion

Icinga is a monitoring system that checks the availabilities of network resources, notifies the user of any outages events. Follow the below link for How to install Icinga Web 2 on CentOS 8.

How to install zabbix Server on Rocky Linux 9

How to set up Zabbix Server on Rocky Linux 9 1. Set Selinux to permissive mode sudo setenforce 0 sudo sed -i...