Using Centreon packages¶
First, SELinux should be disabled. To do this, you have to edit the file /etc/selinux/config and replace enforcing by disabled:
After saving the file, reboot your operating system to apply the changes.
Perform a quick check of the SELinux status:
$ getenforce Disabled
Installing the repository¶
Redhat Software Collections Repository¶
To install Centreon you will need to set up the official software collections repository supported by Redhat.
Software collections are required for installing PHP 7 and associated libraries (Centreon requirement).
Install the software collections repository using this command:
# yum install centos-release-scl
The repository is now installed.
To install Centreon software from the repository, you should first install the centreon-release package, which will provide the repository file.
Install the Centreon repository using this command:
# wget http://yum.centreon.com/standard/18.10/el7/stable/noarch/RPMS/centreon-release-18.10-2.el7.centos.noarch.rpm -O /tmp/centreon-release-18.10-2.el7.centos.noarch.rpm # yum install --nogpgcheck /tmp/centreon-release-18.10-2.el7.centos.noarch.rpm
The repository is now installed.
Some may not have the wget package installed. If not perform the following:
# yum install wget
Installing a Centreon Central Server¶
This section describes how to install a Centreon central server.
Installing a Centreon Central Server with database¶
Run the command:
# yum install centreon # systemctl restart mysql
Installing a Centreon Central Server without database¶
Run the command:
# yum install centreon-base-config-centreon-engine
Installing MySQL on the dedicated server¶
Run the commands:
# yum install centreon-database # systemctl daemon-reload # systemctl restart mysql
centreon-database package installs a database server optimized for use with Centreon.
Centreon does not support the SQL STRICT mode yet. Please make sure that it is disabled. For more information on how to disable the mode please check the official MariaDB documentation.
Then create a distant root account:
mysql> CREATE USER 'root'@'IP' IDENTIFIED BY 'PASSWORD'; mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'IP' WITH GRANT OPTION; mysql> FLUSH PRIVILEGES;
Replace IP by the public IP address of the Centreon server and PASSWORD by the root password.
When running a PHP version before 7.1.16, or PHP 7.2 before 7.2.4, set MySQL 8 Server’s default password plugin to mysql_native_password or else you will see errors similar to The server requested authentication method unknown to the client [caching_sha2_password] even when caching_sha2_password is not used.
This is because MySQL 8 defaults to caching_sha2_password, a plugin that is not recognized by the older PHP releases. Instead, change it by setting default_authentication_plugin=mysql_native_password in my.cnf.
Change the method to store the password using following command:
mysql> ALTER USER 'root'@'IP' IDENTIFIED WITH mysql_native_password BY 'PASSWORD'; mysql> FLUSH PRIVILEGES;
Once the installation is complete you can delete this account using:
mysql> DROP USER 'root'@'IP';
Database management system¶
We recommend using MariaDB for your database because it is open source. Ensure the database server is available to complete the installation (locally or no).
It is necessary to modify LimitNOFILE limitation. Do not try to set this option in /etc/my.cnf because it will not work.
Run the commands:
# mkdir -p /etc/systemd/system/mariadb.service.d/ # echo -ne "[Service]\nLimitNOFILE=32000\n" | tee /etc/systemd/system/mariadb.service.d/limits.conf # systemctl daemon-reload # systemctl restart mysql
Setting the PHP time zone¶
You are required to set the PHP time zone. Run the command:
# echo "date.timezone = Europe/Paris" > /etc/opt/rh/rh-php71/php.d/php-timezone.ini
Change Europe/Paris to your time zone. You can find the supported list of time zone here.
After saving the file, please do not forget to restart the PHP-FPM server:
# systemctl restart rh-php71-php-fpm
Configuring/disabling the firewall¶
Add firewall rules or disable the firewall by running the following commands:
# systemctl stop firewalld # systemctl disable firewalld # systemctl status firewalld
Launching services during system bootup¶
To make services start automatically during system bootup, run these commands on the central server:
# systemctl enable httpd # systemctl enable snmpd # systemctl enable snmptrapd # systemctl enable rh-php71-php-fpm # systemctl enable centcore # systemctl enable centreontrapd # systemctl enable cbd # systemctl enable centengine # systemctl enable centreon
If the MySQL/MariaDB database is on a dedicated server, execute this command on the database server:
# systemctl enable mysql
Concluding the installation¶
Before starting the web installation process, you will need to execute the following commands:
# systemctl start rh-php71-php-fpm # systemctl start httpd # systemctl start mysqld # systemctl start cbd # systemctl start snmpd # systemctl start snmptrapd
To get the IP address of your Centreon server, uses the command:
# ip addr
Log in to Centreon web interface via the URL: http://[SERVER_IP]/centreon. The Centreon setup wizard is displayed. Click on Next.
The Centreon setup wizard checks the availability of the modules. Click on Next.
Click on Next.
Click on Next.
Provide the information on the admin user, then click on Next.
By default, the localhost server is defined and the root password is empty. If you use a remote database server, change these entries. In this case, you only need to define a password for the user accessing the Centreon databases, i.e., Centreon. Click on Next.
If the “Add innodb_file_per_table=1 in my.cnf file under the [mysqld] section and restart MySQL Server.” error message appears, perform the following operations:
Log in to the root user on your server.
Modify this file:
Add these lines to the file:
Restart the mysql service:
# systemctl restart mysql
Click on Refresh.
If you use a deported MySQL v8.x DBMS, you may have the following error message: error. Please have a look to this procedure to solve this issue.
The Centreon setup wizard configures the databases. Click on Next.
You will now be able to install the Centreon server modules.
Click on Install.
Once installation is complete, click on Next.
At this point, an advertisement informs you of the latest Centreon news and products. If your platform is connected to the internet, the information you receive will be up to date. If you are not online, only information on the current version will be displayed.
The installation is complete. Click on Finish.
You can now log in.
To start the monitoring engine :
Log in to the ‘root’ user on your remote server.
Start Centreon Broker
# systemctl start cbd
Start Centreon Engine
# systemctl start centengine
# systemctl start centcore
# systemctl start centreontrapd
To make services automatically start during system bootup run these commands on the remote server:
# systemctl enable centcore # systemctl enable centreontrapd # systemctl enable cbd # systemctl enable centengine # systemctl enable centreon
Enabling the Remote Server option¶
Connect to your Remoter Server and execute following command:
# /usr/share/centreon/bin/centreon -u admin -p centreon -a enableRemote -o CentreonRemoteServer -v '@IP_CENTREON_CENTRAL;<not check SSL CA on Central>;<HTTP method>;<TCP port>;<not check SSL CA on Remote>;<no proxy to call Central>'
Replace @IP_CENTREON_CENTRAL by the IP of the Centreon server seen by the poller. You can define multiple IP address using a coma as separator.
- To use HTTPS, replace @IP_CENTREON_CENTRAL by https://@IP_CENTREON_CENTRAL.
- To use non default port, replace @IP_CENTREON_CENTRAL by @IP_CENTREON_CENTRAL:<port>.
For the <not check SSL CA on Central> option you can put 1 to do not check the SS CA on the Centreon Central Server if HTTPS is enabled, or put 0.
The <HTTP method> is to define how the Centreon Central server can contact the Remote server: HTTP or HTTPS.
The <TCP port> is to define on wich TCP port the entreon Central server can contact the Remote server.
For the <not check SSL CA on Remote> option you can put 1 to do not check the SS CA on the Remote server if HTTPS is enabled, or put 0.
For the <no proxy to call Central> option you can put 1 to do not use HTTP(S) proxy to contact the Centreon Central server.
This command will enable Remote Server mode:
Starting Centreon Remote enable process: Limiting Menu Access...Success Limiting Actions...Done Notifying Master...Success Set 'remote' instance type...Done Centreon Remote enabling finished.
Exchanging SSH Keys¶
Communication between a central server and a poller server is done through SSH.
You need to exchange SSH keys between the servers.
If you do not have any private SSH keys on the central server for the centreon user:
# su - centreon $ ssh-keygen -t rsa
Hit enter when it prompts for a file to save the key to use the default location, or, create one in a specified directory. Leave the passphrase blank. You will receive a key fingerprint and a randomart image.
Generate a password for the centreon user on the new server:
# passwd centreon
Copy this key on to the new server:
# su - centreon $ ssh-copy-id -i .ssh/id_rsa.pub centreon@IP_NEW_SERVER
Configuring a new Centreon Remote Server¶
As of Centreon version 18.10, a wizard is now available for defining a new Centreon Remote Server.
You can configure a new poller manually, however Centreon recommends using the following procedure.
Go to the Configuration > Pollers menu and click Add server with wizard to configure a new poller.
Select Add a Centreon Remote Server and click on Next:
If you enabled the Remote Server option when installing your server, select the option Select a Remote Server, then select your server and fill in the form:
Otherwise, select the Manual input option and fill in the form:
The Database username and Database password are the credentials defined during the installation of the Remote Server.
The Server IP address field is of the following form: [(http|https)://]@IP[:(port)]. If your Remote Server is only available on HTTPS, it is mandatory to define the HTTP method and the TCP port is this one is not the default one.
The Do not check SSL certificate validation option allows to connect to the Remote Server using self-signed SSL certificate.
The Do not use configured proxy tp connect to this server allows to connect to the Remote Server without using the proxy configuration of the Centreon Central server.
Click on Next.
Select the poller(s) to link to this Remote Server, then click on Apply:
The wizard will configure your new server:
Once the configuration is exported, restart the Centreon Broker process on the Remote Server using the following command:
# systemctl restart cbd
The Remote Server is now configured:
Go to the Quick Start chapter to configure your first monitoring. chapter to configure your first monitoring.