Thursday, December 26, 2024
Google search engine
HomeGuest BlogsInstall Centreon Monitoring Tool on CentOS 8 | Rocky Linux 8

Install Centreon Monitoring Tool on CentOS 8 | Rocky Linux 8

.tdi_3.td-a-rec{text-align:center}.tdi_3 .td-element-style{z-index:-1}.tdi_3.td-a-rec-img{text-align:left}.tdi_3.td-a-rec-img img{margin:0 auto 0 0}@media(max-width:767px){.tdi_3.td-a-rec-img{text-align:center}}

Monitoring is a key component of Infrastructure and Applications management, be it on-premise or in Cloud setups. There is a large pool of tools that you can choose from when making a decision on what to adopt in your Infrastructure. The core framework of Centreon platform is released under GPLv2 and Apache Open Source licenses. In our article today we will install Centreon Open Source project on CentOS 8 | Rocky Linux 8 systems. Centreon project was started in 2005 and is now used by over 200,000 IT Professionals all over the world.

Some key features of Centreon monitoring tool are:

  • Open-Source flexibility – The software licensing gives you flexibility to innovate around it.
  • Unmatched monitoring scope – Through its extensive set of monitoring components and features
  • Robust Plugin Library – With over 450 plugins to give you exhaustive visibility on your entire IT infrastructure.
  • Custom Dashboards – Flexibility of creating custom monitoring dashboards
  • Efficient Event Management – Easy to track flow of events
  • Scalable & HA – Support for HA design and implementation
  • Role-Based Access Control – You can freely limit access to the tool for users and groups.
  • Seamless Integrations – Ease of integration with third party solutions and platforms
  • Distributed Monitoring & Operations

Our installation guide adopts the simplest architecture with all oversight entities running within the same server, ie:

.tdi_2.td-a-rec{text-align:center}.tdi_2 .td-element-style{z-index:-1}.tdi_2.td-a-rec-img{text-align:left}.tdi_2.td-a-rec-img img{margin:0 auto 0 0}@media(max-width:767px){.tdi_2.td-a-rec-img{text-align:center}}

  • Centreon web interface – Powered by Apache web server
  • Databases (MySQL + RRD) – Store Centreon configuration parameters as well as monitoring and performance data
  • Monitoring Engine – This is for data collection
  • Broker – Centreon Broker SQL allows to store information into MariaDB databases and forward them to Centreon Broker RRD
centreon simple architecture standalone

The Centreon Broker RRD generates and updates RRD files with data in order to display performance graphs.

Below are steps to be followed when installing Centreon on CentOS 8 | Rocky Linux 8.

Step 1: Update System and Configure NTP

We begin the installation by upgrading all the packages in the system to the latest releases:

sudo yum -y update

Define the server name using following command. Replace centreon.geeksforgeeks.org with your correct dns name to be used.

hostnamectl set-hostname centreon.geeksforgeeks.org

Install chrony ntp package on the system by running the command below.

sudo yum -y install chrony

Set correct timezone on the server using timedatectl command. You can list timezone data on your system on the directory /usr/share/zoneinfo/:

sudo timedatectl set-timezone Africa/Nairobi
sudo timedatectl set-ntp yes

Then start and enable chronyd service:

sudo systemctl enable  chronyd
sudo systemctl restart chronyd

Synchronize time on the system:

sudo timedatectl set-ntp yes
sudo timedatectl set-local-rtc 0
sudo chronyc sources

Current date and time configured can be checked with the command:

$ timedatectl
               Local time: Fri 2022-10-14 13:03:10 EAT
           Universal time: Fri 2022-10-14 10:03:10 UTC
                 RTC time: Fri 2022-10-14 10:03:10
                Time zone: Africa/Nairobi (EAT, +0300)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

Put SELinux in Permissive mode

sudo sed -i s/^SELINUX=.*$/SELINUX=permissive/ /etc/selinux/config
sudo setenforce 0

Step 2: Install PHP and Centreon Packages

Install REMI repository:

sudo dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
sudo dnf install -y https://rpms.remirepo.net/enterprise/remi-release-8.rpm
sudo dnf config-manager --set-enabled 'powertools'

Enable PHP 8.0 module

sudo dnf module reset php -y
sudo dnf module install php:remi-8.0 -y

Add Centreon repository

sudo dnf install -y https://yum.centreon.com/standard/22.04/el8/stable/noarch/RPMS/centreon-release-22.04-3.el8.noarch.rpm

Install Centreon monitoring engine:

sudo dnf install -y centreon

Configure PHP Timezone

echo "date.timezone = Africa/Nairobi" | sudo tee -a /etc/php.d/50-centreon.ini

Restart PHP FPM service

sudo systemctl restart php-fpm

The package centreon-database installs an optimized MariaDB configuration to be used with Centreon:

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

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

Start and enable all required services to start automatically during system bootup:

sudo systemctl enable --now php-fpm httpd centreon cbd centengine gorgoned snmptrapd centreontrapd snmpd

Step 3: Configure MariaDB database

Enable and start MariaDB service

sudo systemctl enable --now mariadb

Set root password and remove test user

$ sudo mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
haven't set the root password yet, you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password or using the unix_socket ensures that nobody
can log into the MariaDB root user without the proper authorisation.

You already have your root account protected, so you can safely answer 'n'.

Switch to unix_socket authentication [Y/n] y
Enabled successfully!
Reloading privilege tables..
 ... Success!


You already have your root account protected, so you can safely answer 'n'.

Change the root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y
 ... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

Test connection as root user

$ mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 12
Server version: 10.5.15-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> quit
Bye

Step 4: Perform Centreon Web installation

Ensure http service is running:

$ systemctl status httpd
httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
  Drop-In: /usr/lib/systemd/system/httpd.service.d
           └─php-fpm.conf
   Active: active (running) since Fri 2022-10-14 13:01:09 EAT; 34s ago
     Docs: man:httpd.service(8)
 Main PID: 38469 (httpd)
   Status: "Total requests: 1; Idle/Busy workers 100/0;Requests/sec: 0.0345; Bytes served/sec:  21 B/sec"
    Tasks: 278 (limit: 49442)
   Memory: 33.0M
   CGroup: /system.slice/httpd.service
           ├─38469 /usr/sbin/httpd -DFOREGROUND
           ├─38499 /usr/sbin/httpd -DFOREGROUND
           ├─38500 /usr/sbin/httpd -DFOREGROUND
           ├─38501 /usr/sbin/httpd -DFOREGROUND
           ├─38502 /usr/sbin/httpd -DFOREGROUND
           └─38749 /usr/sbin/httpd -DFOREGROUND

Oct 14 13:01:08 rocky8.mylab.io systemd[1]: Starting The Apache HTTP Server...
Oct 14 13:01:09 rocky8.mylab.io systemd[1]: Started The Apache HTTP Server.
Oct 14 13:01:09 rocky8.mylab.io httpd[38469]: Server configured, listening on: port 80

Enable ports in firewall if Firewalld service is running:

# For default protocols
sudo firewall-cmd --zone=public --add-service={ssh,http,https,snmp,snmptrap} --permanent

# Centreon Gorgone
sudo firewall-cmd --zone=public --add-port=5556/tcp --permanent

# Centreon Broker
sudo firewall-cmd --zone=public --add-port=5669/tcp --permanent

Reload firewalld:

sudo firewall-cmd --reload

Log in to Centreon web interface via the URL:

http://<IP>/centreon

You should see Centreon Setup Welcome page. The installer program is designed to help you setup your database and your monitoring configuration.

Install Centreon Monitoring Tool CentOS 8 Rocky Linux 8 01

Confirm the dependency checks are all successful.

Install Centreon Monitoring Tool CentOS 8 Rocky Linux 8 02

Customize monitoring engine information as you deem fit

Install Centreon Monitoring Tool CentOS 8 Rocky Linux 8 03

More engine information, it is recommended to use defaults.

Install Centreon Monitoring Tool CentOS 8 Rocky Linux 8 04

Create admin user

Install Centreon Monitoring Tool CentOS 8 Rocky Linux 8 05

In database configuration section input:

  • root user password
  • Centreon database name, user and password

The Centreon setup wizard creates configuration files and databases structure.

Install Centreon Monitoring Tool CentOS 8 Rocky Linux 8 06

Database configurations should begin

Install Centreon Monitoring Tool CentOS 8 Rocky Linux 8 09

Check all modules and click “Install“.

Install Centreon Monitoring Tool CentOS 8 Rocky Linux 8 10

Click “Next

Install Centreon Monitoring Tool CentOS 8 Rocky Linux 8 11

Finish installation to start using Centreon to monitor your Infrastracture.

Install Centreon Monitoring Tool CentOS 8 Rocky Linux 8 12

Login using created username and password:

Install Centreon Monitoring Tool CentOS 8 Rocky Linux 8 08

In the upcoming posts on Centreon we will cover how you can monitor your IT infrastructure with this powerful monitoring tool.

Recommended Linux books:

.tdi_4.td-a-rec{text-align:center}.tdi_4 .td-element-style{z-index:-1}.tdi_4.td-a-rec-img{text-align:left}.tdi_4.td-a-rec-img img{margin:0 auto 0 0}@media(max-width:767px){.tdi_4.td-a-rec-img{text-align:center}}

RELATED ARTICLES

Most Popular

Recent Comments