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 RepositoryThe 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
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
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
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
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
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
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"
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.
No comments:
Post a Comment