AlmaLinuxLinuxTutorials

How To Install Centreon Monitoring on AlmaLinux 8

Install Centreon Monitoring on AlmaLinux 8

In this tutorial, we will show you how to install Centreon Monitoring on AlmaLinux 8. For those of you who didn’t know, Centreon is an open-source tool that can monitor your entire infrastructure including network, system, and application. Centreon drives business performance excellence aligning IT operations with business objectives. Using Centreon you can set notifications depending on thresholds, set email alerts, easily add any system 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 through the step-by-step installation of the Centreon monitoring on an AlmaLinux 8. You can follow the same instructions for Fedora, RHEL, CentOS, and Rocky Linux distributions.

Prerequisites

  • A server running one of the following operating systems: AlmaLinux 8, CentOS, and Rocky Linux 8.
  • 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 Centreon Monitoring on AlmaLinux 8

Step 1. First, let’s start by ensuring your system is up-to-date.

sudo dnf update
sudo dnf install epel-release

Step 2. Disable SELinux on AlmaLinux 8.

You can check the current status of SELinux using the following command:

sestatus

Output:

SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   enforcing
Mode from config file:          enforcing
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Memory protection checking:     actual (secure)
Max kernel policy version:      16

To permanently set the SELinux mode to permissive, run the following command:

sudo nano /etc/selinux/config

Change the SELINUX value to disabled:

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#       enforcing - SELinux security policy is enforced.
#       permissive - SELinux prints warnings instead of enforcing.
#       disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these three values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected. 
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

Save the file and reboot the system:

reboot

Step 3. Installing Apache on AlmaLinux 8.

Run the following command to install the Apache HTTP server:

sudo dnf install httpd httpd-tools

Once installed Apache services on your system, start all required services:

sudo systemctl enable httpd
sudo systemctl start httpd
sudo systemctl status httpd

Step 4. Installing PHP on AlmaLinux 8.

PHP is a popular scripting language that powers the dynamic content of millions of websites and apps. Now we run the commands below to install PHP:

sudo dnf install php-cli php-fpm php-mysqlnd php-dom php-simplexml php-xml php-curl php-exif php-ftp php-gd php-iconv php-json php-mbstring php-posix

Verify and check PHP version:

php --version

With the new version of Centreon, you have to configure the good timezone of the PHP file. Now you must change create a file to indicate your appropriate timezone:

sudo nano /etc/php.d/php-timezone.ini

Add the following configuration:

date.timezone = Etc/UTC

Next, now increase PHP script execution timeout by editing max_execution_time and max_input_time in php.ini file:

sudo nano /etc/php.ini

Add the following file:

max_execution_time = 300
max_input_time = 300

Save the file, enable and restart the PHP-FPM service using the following command below:

sudo systemctl enable php-fpm
sudo systemctl restart php-fpm

Step 5. Installing MariaDB on AlmaLinux 8.

MariaDB is a popular database server. The installation is simple and requires just a few steps as shown:

sudo dnf install mariadb-server mariadb

Once the installation is complete, start to enable it to start on system start-up using:

sudo systemctl restart mariadb
sudo systemctl status mariadb
sudo systemctl enable mariadb

By default, MariaDB is not hardened. You can secure MariaDB using the mysql_secure_installation script. you should read and below each step carefully which will set a root password, remove anonymous users, disallow remote root login, and remove the test database and access to secure MariaDB:

mysql_secure_installation

Configure it like this:

- Set root password? [Y/n] y
- Remove anonymous users? [Y/n] y
- Disallow root login remotely? [Y/n] y
- Remove test database and access to it? [Y/n] y
- Reload privilege tables now? [Y/n] y

To log into MariaDB, use the following command (note that it’s the same command you would use to log into a MariaDB database):

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 Centreon installation:

MariaDB [(none)]> CREATE DATABASE centreon_database;
MariaDB [(none)]> CREATE USER ‘centreon_user’@’localhost’ IDENTIFIED BY ‘strong-your-password’;
MariaDB [(none)]> GRANT ALL ON centreon_database.* TO ‘centreon_user’@'localhost’ IDENTIFIED BY ‘strong-your-password’ WITH GRANT OPTION;
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT

Step 6. Installing Centreon Monitoring on AlmaLinux 8.

By default, Centreon is not available on the AlmaLinux base repository. Now we add the Centreon repository to your AlmaLinux system:

sudo dnf install https://yum.centreon.com/standard/21.10/el8/stable/noarch/RPMS/centreon-release-21.10-2.el8.noarch.rpm

After that, install Centreon packages using the following command below:

sudo dnf install centreon centreon-database

Next, set optimized MariaDB configuration for Centreon:

cat /etc/systemd/system/mariadb.service.d/centreon.conf
[Service]
LimitNOFILE=32000

Let’s have a look at the configuration file:

cat /etc/my.cnf.d/centreon.cnf

This requires a restart on the MariaDB service:

sudo systemctl daemon-reload
sudo systemctl restart mariadb

Before starting the Centreon Web installation process, you need to execute the following commands below:

sudo systemctl start mariadb
sudo systemctl start php-fpm
sudo systemctl start httpd
sudo systemctl start centreon
sudo systemctl start cbd
sudo systemctl start centengine
sudo systemctl start gorgoned
sudo systemctl start snmptrapd
sudo systemctl start centreontrapd
sudo systemctl start snmpd

Step 7. Accessing Centreon Monitoring Web Interface.

Once successfully installed, open your web browser and access the Centreon using the URL http://your-IP-address/centreon. This will show you the Welcome to Centreon Setup screen as shown below and complete the required steps to finish the installation

Install Centreon Monitoring on AlmaLinux 8

Congratulations! You have successfully installed Centreon. Thanks for using this tutorial for installing Centreon monitoring on your AlmaLinux 8 system. For additional help or useful information, we recommend you check the official Centreon 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