How to Install Centreon on Centos 7 for Monitoring

Install Centreon linuxFor Sysadmins, it is very important to be able to check the state of each service and equipment provided on the network. You must be able to be informed and to react anytime if a problem occurs. It exists some popular tools available but few can give you an easy management method. It exists a tool named Centreon which gives us this opportunity. Centreon offers two installation methods, one with the Centreon ISO and the another one with Centreon Web which can be installed directly on a Linux OS as Centos or Debian.

Centreon offers two installation methods, one with the Centreon ISO and the another one with Centreon Web which can be installed directly on a Linux OS as Centos or Debian. You can see sometimes that some sysadmin refer Centreon to Centreon-Web, this is because it Centreon started only with a web interface and console to be used with Nagios. Now Centreon integrates Web UI, a monitoring system that enables data extraction, collection, and treatment with an autonomous event broker and database system. The new versions of Centreon don't need to be associated with Nagios as before.

What is centreon?

Centreon is a free Open Source monitoring software which allows an administrator to easily configure alerts based on thresholds, generate email alerts, add systems to be monitored quickly without the need of configuring complicated configuration files. Centreon is based on

  • centreon engine: the main monitoring engine which is going to check equipment through probes (plugins)
  • centreon web: the IHM allowing to configure the engine and to show its result in real time and with graph
  • centron broker: it is the link between previous both elements, it is a "carrier" of data.

Centreon offers flexible configuration through the differents architecture that it supports:

  • Simple architecture: it is used to have all oversight entities within the same server: the centreon web interface, databases, monitoring engine and broker
  • Distributed architecture: it consists of two types of entities: a central Centreon server to display information and one or more remote servers to collect data. It is used to enable load balancing across multiple remote monitoring servers and for network streams isolation
  • Distributed architecture with remote DBMS: this architecture with remote DBMS is to have three types of entities: a central Centreon server to display information, a DBMS server to store information into databases and one or more remote servers to collect data. Its advantage is to have a remote DBMS server
  • Distributed architecture with failover: this architecture counts a central Centreon server to display information and one or more remote servers to collect data. To have a failover the centreon central server is duplicated. It is used to enable load balancing across multiple remote monitoring servers, for network streams isolation and to have a failover system
  • Distributed architecture with failover and web GUI for remote server: In addition to the advantages of the previous architecture, it allows to have a local web display only interface of Centreon on each remote server. It is used to have a read-only interface on each poller to have access to locally collected data if a failure connection appears between the remote server and centreon central server.

When writing this article, the actual version our monitoring tool is centreon 2.8.11

1) Install the pre-requisites

We need to disable SELinux for our first step. Check it with the command

# selinuxenabled && echo enabled || echo disabled
disabled

It is disabled on our side but if it is not the same result for you, you must edit its configuration file and replace enforcing by disabled

# vim /etc/selinux/config
SELINUX=disabled

It is recommended to use MariaDB for the database.

# yum install mariadb-server
..............................
..............................
Resolving Dependencies
--> Running transaction check
---> Package mariadb-server.x86_64 1:5.5.52-1.el7 will be installed
--> Processing Dependency: mariadb(x86-64) = 1:5.5.52-1.el7 for package: 1:mariadb-server-5.5.52-1.el7.x86_64
--> Processing Dependency: perl-DBI for package: 1:mariadb-server-5.5.52-1.el7.x86_64
--> Processing Dependency: perl-DBD-MySQL for package: 1:mariadb-server-5.5.52-1.el7.x86_64

It is necessary to modify LimitNOFILE limitation by setting the option into /etc/my.cnf

# mkdir -p  /etc/systemd/system/mariadb.service.d/
# echo -ne "[Service]\nLimitNOFILE=32000\n" | tee /etc/systemd/system/mariadb.service.d/limits.conf

Now restart it and allow it to be launched at the startup

# systemctl daemon-reload
# systemctl start mariadb
# systemctl enable mariadb
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.

2) Install Centreon

You should need to install some packages like the RPMForge

# wget http://yum.centreon.com/standard/3.4/el7/stable/noarch/RPMS/centreon-release-3.4-4.el7.centos.noarch.rpm
# yum install --nogpgcheck centreon-release-3.4-4.el7.centos.noarch.rpm
.............................
.............................
Dependencies Resolved

==========================================================================================================================
 Package                  Arch           Version                  Repository                                         Size
==========================================================================================================================
Installing:
 centreon-release         noarch         3.4-4.el7.centos         /centr

Now you can install the centreon package

# yum install centreon-base-config-centreon-engine centreon
..............................
..............................
Transaction Summary
==========================================================================================================================
Install  2 Packages (+273 Dependent packages)
Upgrade             (   2 Dependent packages)

Total download size: 103 M
Is this ok [y/d/N]: y

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.

# vim /etc/php.d/php-timezone.ini
date.timezone = Etc/UTC

Now you can restart Apache, MariaDB and allow the snmp service to be automatically launched at the startup.

# systemctl restart httpd mariadb
# systemctl enable httpd snmpd snmptrapd
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/snmpd.service to /usr/lib/systemd/system/snmpd.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/snmptrapd.service to /usr/lib/systemd/system/snmptrapd.service.

3) Centreon web installation

When you have finished the installation, you can now graphically access to your server and continue the process by the web browser. So, enter the ip address of your server http://<centreon-ip>/

You should choose next button

Here you have all the module checked

Here you have the monitoring engine information

Here you have the broker information

Here you create a user account to access the web interface. Don't forget the password

Here it is the database information. You should enter a password for the database user but not for the root user of the database.

Now during the installation, it shows that all the operations have been completed with success.

4) Connection to the administration webpage of centreon

Now that the installation is finished and you can try to access again to centreon webpage by the ip address or the domain name if it is configured.

You can now log in with the username and the password configured on step 5 during the creation of the user's account.

When you go to Home -> Poller Statistics, you can see that our centreon has no information and no services installed

You can also see that our poller is not running

And there is no widget installed. So, we need to start services and install widget to have a basic functional centreon

5) Start services and install centreon widgets

To start centreon's services, you must enter the command below on your terminal:

# systemctl start cbd 

# systemctl start centcore

# systemctl start centreontrapd

Now you can return to the administration page of centreon to select the poller and import the configuration. The poller or remote servers are monitoring server equipped with a scheduler and a broker module. Their function is to monitor the equipment and send the results to the Centreon central server.

Go to Configuration -> Pollers and select the server to export the configuration. The new version of centreon doesn't have any configuration for command or examples. This is because centreon comes with a new approach which is IMP (Instant Monitoring Platform), a solution to allow to reduce the time to monitoring.

Now stick the four first propositions and choose restart for the method then, export

Now you can check the result

You can see that the poller is running. You can see the poller statistic at the home page

Now we can install the widgets on our centreon server which are not installed automatically

# yum install centreon-widget*
Loaded plugins: fastestmirror
base | 3.6 kB 00:00 
centreon-stable | 2.9 kB 00:00 
centreon-stable-noarch | 2.9 kB 00:00 
.............................
.............................
Transaction Summary
================================================================================
Install  12 Packages

Total download size: 206 k
Installed size: 434 k
Is this ok [y/d/N]: y

Now we can activate them through the administration page

You can see that widgets are installed and can be used. Our centreon server is ready to be configured and used properly

Centreon is a good tool for monitoring which has evolved and don't need to be associated with nagios components. It acts now very independently and offers easy configuration methods. There are some changes with this new version of centreon which offers a good and easy integration on centos 7 through the packages installation.

About Alain Francois

IT Linux administrator passionate of free and open source software, I work on Linux Systems since some years on installations and deployments of certain solutions. I like to share my experiences with a wider audience by training and conferences.

Author Archive Page

Have anything to say?

Your email address will not be published. Required fields are marked *

All comments are subject to moderation.