Using packages
Centreon provides RPM packages for its products through the Centreon Open Source version available free of charge in our repository.
These packages can be installed on CentOS 7, on Alma/RHEL/Oracle Linux 8 and on Debian 11.
You must run the installation procedure as a privileged user.
Prerequisites
After installing your server, update your operating system using the following command:
- Alma / RHEL / Oracle Linux 8
- CentOS 7
- Debian 11
dnf update
Additional configuration
If you intend to use Centreon in French, Spanish, Portuguese or German, install the corresponding packages:
dnf install glibc-langpack-fr
dnf install glibc-langpack-es
dnf install glibc-langpack-pt
dnf install glibc-langpack-de
Use the following command to check which languages are installed on your system:
locale -a
yum update
apt update && apt upgrade
Accept all GPG keys and consider rebooting your server if a kernel update is proposed.
Step 1: Pre-installation
Disable SELinux
- Alma / RHEL / Oracle Linux 8
- CentOS 7
- Debian 11
During installation, SELinux should be disabled. To do this, edit the file /etc/selinux/config and replace enforcing by disabled. You can also run the following command:
sed -i s/^SELINUX=.*$/SELINUX=disabled/ /etc/selinux/config
Reboot your operating system to apply the change.
reboot
After the system reboot, perform a quick check of the SELinux status:
getenforce
You should have this result:
Disabled
Note that this deactivation should be temporary. SELinux should be reenabled after installation for security reasons.
During installation, SELinux should be disabled. To do this, edit the file /etc/selinux/config and replace enforcing by disabled. You can also run the following command:
sed -i s/^SELINUX=.*$/SELINUX=disabled/ /etc/selinux/config
Reboot your operating system to apply the change.
reboot
After system startup, perform a quick check of the SELinux status:
getenforce
You should have this result:
Disabled
Note that this deactivation should be temporary. SELinux should be reenabled after installation for security reasons.
SELinux is not installed on Debian 11, continue.
Configure or disable the firewall
If your firewall is active, add firewall rules. You can also disable the firewall during installation by running the following commands:
systemctl stop firewalld
systemctl disable firewalld
Install the repositories
- Alma 8
- RHEL 8
- Oracle Linux 8
- CentOS 7
- Debian 11
Remi repository
To install Centreon you will need to install the remi repository.
Run the following commands:
dnf install -y dnf-plugins-core
dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
dnf install -y https://rpms.remirepo.net/enterprise/remi-release-8.rpm
dnf config-manager --set-enabled 'powertools'
Enable PHP 8.1 using the following commands:
dnf module reset php
dnf module install php:remi-8.1
Remi and CodeReady Builder repository
To install Centreon you will need to install the remi and CodeReady Builder repositories.
Run the following commands:
dnf install -y dnf-plugins-core
dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
dnf install -y https://rpms.remirepo.net/enterprise/remi-release-8.rpm
subscription-manager repos --enable codeready-builder-for-rhel-8-x86_64-rpms
If your server is a Cloud RHEL instance, you will have to execute the following command:
dnf config-manager --set-enabled codeready-builder-for-rhel-8-rhui-rpms
Enable PHP 8.1 using the following commands:
dnf module reset php
dnf module install php:remi-8.1
Remi and CodeReady Builder repositories
To install Centreon you will need to install the remi and CodeReady Builder repositories.
Run the following commands:
dnf install -y dnf-plugins-core
dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
dnf install -y https://rpms.remirepo.net/enterprise/remi-release-8.rpm
dnf config-manager --set-enabled ol8_codeready_builder
Enable PHP 8.1 using the following commands:
dnf module reset php
dnf module install php:remi-8.1
Redhat Software Collections repository
To install Centreon you will need to set up the official Software Collections repository supported by Redhat. It is required for installing apache 2.4.
Install the Software Collections repository using this command:
yum install -y centos-release-scl
Remi repository
To install Centreon you will need to install the remi repository.
Run the following commands:
yum install -y yum-utils
yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum install -y https://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum-config-manager --enable remi-php81
Install dependencies
Install the following dependencies:
apt update && apt install lsb-release ca-certificates apt-transport-https software-properties-common wget gnupg2 curl
Add Sury APT repository for PHP 8.1
To install the Sury repository, execute the following command:
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/sury-php.list
Then import the repository key:
wget -O- https://packages.sury.org/php/apt.gpg | gpg --dearmor | tee /etc/apt/trusted.gpg.d/php.gpg > /dev/null 2>&1
apt update
MariaDB repository
- Alma / RHEL / Oracle Linux 8
- CentOS 7
- Debian 11
curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup | sudo bash -s -- --os-type=rhel --os-version=8 --mariadb-server-version="mariadb-10.5"
curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup | sudo bash -s -- --os-type=rhel --os-version=7 --mariadb-server-version="mariadb-10.5"
curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup | bash -s -- --os-type=debian --os-version=11 --mariadb-server-version="mariadb-10.5"
Centreon repository
To install Centreon software, you should first install the Centreon repository.
Install the Centreon repository using this command:
- Alma / RHEL / Oracle Linux 8
- CentOS 7
- Debian 11
dnf install -y dnf-plugins-core
dnf config-manager --add-repo https://packages.centreon.com/rpm-standard/22.10/el8/centreon-22.10.repo
yum install -y yum-utils
yum-config-manager --add-repo https://packages.centreon.com/rpm-standard/22.10/el7/centreon-22.10.repo
To install the Centreon repository, execute following command line:
echo "deb https://packages.centreon.com/apt-standard-22.10-stable $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/centreon.list
echo "deb https://packages.centreon.com/apt-plugins-stable/ $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/centreon-plugins.list
Then import the repository key:
wget -O- https://apt-key.centreon.com | gpg --dearmor | tee /etc/apt/trusted.gpg.d/centreon.gpg > /dev/null 2>&1
Step 2: Installation
This section describes how to install a Centreon Remote Server.
It's possible to install this server with a local database on the server, or a remote database on a dedicated server.
With a local database
- Alma / RHEL / Oracle Linux 8
- CentOS 7
- Debian 11
dnf install -y centreon-database centreon-central
systemctl daemon-reload
systemctl restart mariadb
yum install -y centreon
systemctl daemon-reload
systemctl restart mariadb
apt update
apt install -y --no-install-recommends centreon
systemctl daemon-reload
systemctl restart mariadb
You can now move on to the next step.
With a remote database
If installing database on a dedicated server, this server should also have the prerequired repositories.
Run the following command on the Central server:
- Alma / RHEL / Oracle Linux 8
- CentOS 7
- Debian 11
dnf install -y centreon-central
yum install -y centreon-central
apt update
apt install -y --no-install-recommends centreon-central
Then run the following commands on the dedicated server:
- Alma / RHEL / Oracle Linux 8
- CentOS 7
- Debian 11
dnf install -y centreon-database
systemctl daemon-reload
systemctl restart mariadb
yum install -y centreon-database
systemctl daemon-reload
systemctl restart mariadb
apt update
apt install -y --no-install-recommends centreon-database
systemctl daemon-reload
systemctl restart mariadb
Secure your MariaDB installation by executing the following command:
mysql_secure_installation
It is mandatory to set a password for the root user of the database.
Then, in the remote dabatase, create a user with root privileges. You will have to enter this user during the web installation process (at step 6, in the Root user and Root password fields).
CREATE USER '<USER>'@'<IP>' IDENTIFIED BY '<PASSWORD>';
GRANT ALL PRIVILEGES ON *.* TO '<USER>'@'<IP>' WITH GRANT OPTION;
FLUSH PRIVILEGES;
Replace <IP> with the Centreon Central IP address that will connect to the database server.
Replace <USER> and <PASSWORD> by user's credentials.
This user will only be used for the installation process. Once the web installation is complete you can delete this user using:
DROP USER '<USER>'@'<IP>';
The package centreon-database installs an optimized MariaDB configuration to be used with Centreon.
If this package is not installed, system limitation LimitNOFILE should be at least set to 32000 using a dedicated configuration file, example:
$ cat /etc/systemd/system/mariadb.service.d/centreon.conf
[Service]
LimitNOFILE=32000Same for the MariaDB open_files_limit directive, example for Centos 7, Alma/RHEL/OL 8:
$ cat /etc/my.cnf.d/centreon.cnf
[server]
innodb_file_per_table=1
open_files_limit=32000For Debian 11:
$ cat /etc/mysql/mariadb.conf.d/80-centreon.cnf
[server]
innodb_file_per_table=1
open_files_limit=32000Remember to restart MariaDB after a change to configuration.
Additional configuration for Debian 11
MariaDB has to listen to all interfaces instead of localhost/127.0.0.1, which is the default value. Edit the following file:
/etc/mysql/mariadb.conf.d/50-server.cnf
Set the bind-address parameter to 0.0.0.0.
Step 3: Configuration
Server name
If you want, you can change the server's name using the following command:
hostnamectl set-hostname new-server-name
Replace new-server-name by the name you want. Example:
hostnamectl set-hostname remote1
Set the PHP time zone
You are required to set the PHP time zone.
- Alma / RHEL / Oracle Linux 8 / CentOS 7
- Debian 11
Run the command:
echo "date.timezone = Europe/Paris" >> /etc/php.d/50-centreon.ini
Replace Europe/Paris by your time zone. You can find the list of supported time zones here.
After saving the file, please do not forget to restart the PHP-FPM service:
systemctl restart php-fpm
Edit the /etc/php/8.1/mods-available/centreon.ini file and check the timezone.
This one was defined during the installation process by retrieving the timezone configured on the operating system.
You can find the list of supported time zones here.
After saving the file, restart the PHP-FPM service:
systemctl restart php8.1-fpm
Services startup during system bootup
To make services start automatically during system bootup, run these commands on the central server:
- Alma / RHEL / Oracle Linux 8
- CentOS 7
- Debian 11
systemctl enable php-fpm httpd centreon cbd centengine gorgoned snmptrapd centreontrapd snmpd
systemctl enable crond
systemctl start crond
systemctl enable php-fpm httpd24-httpd centreon cbd centengine gorgoned snmptrapd centreontrapd snmpd
systemctl enable php8.1-fpm apache2 centreon cbd centengine gorgoned centreontrapd snmpd snmptrapd
Then execute the following command (on the remote server if you are using a local database, or on your dedicated database server):
systemctl enable mariadb
systemctl restart mariadb
Secure the database
If you have installed the Centreon server with a local database, since MariaDB 10.5, it is mandatory to secure the database's root access before installing Centreon. Run the following command:
mysql_secure_installation
- Answer yes to all questions except "Disallow root login remotely?".
- It is mandatory to set a password for the root user of the database. You will need this password during the web installation.
For more information, please see the official MariaDB documentation.
Step 4: Web installation
- Start the Apache server with the following command:
- Alma / RHEL / Oracle Linux 8
- CentOS 7
- Debian 11
systemctl start httpd
systemctl start httpd24-httpd
systemctl start apache2
- To complete the installation, follow the web installation steps procedure.
During web installation, it is not necessary to install Autodiscovery module.
In the step Initialization of the monitoring, only the actions from 6 to 8 must be done.
Step 5: Register the server
To transform the server into a Remote Server and to register it to the Central server or to another Remote server, execute the following command on the future remote server:
/usr/share/centreon/bin/registerServerTopology.sh -u <API_ACCOUNT> \
-t remote -h <IP_TARGET_NODE> -n <REMOTE_NAME>
Example:
/usr/share/centreon/bin/registerServerTopology.sh -u admin -t remote -h 192.168.0.1 -n remote-1
Replace <IP_TARGET_NODE> by the IP of the central server, as seen by the remote server.
The <API_ACCOUNT> must have access to the configuration API. You can use the default admin account.
If you need to change the HTTP method or the port, you can use the following format for the -h option:
HTTPS:/<IP_TARGET_NODE>:PORT
Then follow instructions by
-
Entering your password:
192.168.0.1: please enter your password:
-
Select the IP address if multiple network interfaces exist:
Which IP do you want to use as CURRENT NODE IP ?
1) 192.168.0.2
2) 192.168.0.3
1 -
Then validate the information:
Summary of the informations that will be send:
Api Connection:
username: admin
password: ******
target server: 192.168.0.1
Pending Registration Server:
name: remote-1
type: remote
address: 192.168.0.2
Do you want to register this server with those informations ? (y/n)y -
Add additional information to enable future communication between your Remote Server and its Central, fill in the required information to convert your platform into a Remote server:
<CURRENT_NODE_ADDRESS> : Please enter your username:
admin
<CURRENT_NODE_ADDRESS> : Please enter your password:
<CURRENT_NODE_ADDRESS> : Protocol [http]:
<CURRENT_NODE_ADDRESS> : Port [80]:
<CURRENT_NODE_ADDRESS> : centreon root folder [centreon]:
-
If you use a proxy, please define credentials:
Are you using a proxy ? (y/n)
y
enter your proxy Host:
myproxy.example.com
enter your proxy Port [3128]:
Are you using a username/password ? (y/n)
y
enter your username:
my_proxy_username
enter your password:
You will receive the validation of the Centreon central server:
2020-10-16T17:19:37+02:00 [INFO]: The CURRENT NODE 'remote: 'remote-1@192.168.0.2' has been converted and registered successfully.
Main error messages
2020-10-20T10:23:15+02:00 [ERROR]: Invalid credentials
Your credentials are incorrect for the <API_ACCOUNT>.
2020-10-20T10:24:59+02:00 [ERROR]: Access Denied.
The <API_ACCOUNT> doesn't have access to configuration API.
Failed connect to 192.168.0.1:444; Connection refused
Unable to access to the API. Please check <IP_TARGET_NODE>, scheme and port.
2020-10-20T10:39:30+02:00 [ERROR]: Can’t connect to the API using: https://192.168.0.1:443/centreon/api/latest/login
The access url is not complete or invalide. Use the --root option to define the API URL Path. For example: --root monitoring.
2020-10-20T10:42:23+02:00 [ERROR]: No route found for “POST /centreon/api/latest/platform/topology”
Your Centreon target version is invalid. It should be greater or equal to 22.10.
Step 6: Extend local DBMS rights
Finally, add rights to centreon database user to use LOAD DATA INFILE command:
mysql -u root -p
GRANT FILE on *.* to 'centreon'@'localhost';
exit
Step 7: Add the Remote Server to configuration
Go to the Add a Remote Server to configuration.
Step 8: Secure your platform
Do not forget to secure your Centreon platform following our recommendations