Upgrade from Centreon 22.04
This chapter describes how to upgrade your Centreon platform from version 22.04 to version 22.10.
When you upgrade your central server, make sure you also upgrade all your remote servers and your pollers. All servers in your architecture must have the same version of Centreon. In addition, all servers must use the same version of the BBDO protocol.
If you want to migrate your Centreon platform to another server/OS, please read our chapter on migration. you need to follow the migration procedure.
Prerequisitesβ
Perform a backupβ
Be sure that you have fully backed up your environment for the following servers:
- Central server
- Database server
Upgrade the Centreon Central serverβ
Update the Centreon repositoryβ
Run the following commands:
- 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
sed -i -E 's|[0-9]{2}\.[0-9]{2}|22.10|g' /etc/apt/sources.list.d/centreon.list
apt update
If you have an offline license, install the corresponding repository for the plugin packs. If you are using a Business edition, install the correct Business repository too. You can find the repositories on the support portal.
Install the 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 | sudo bash -s -- --os-type=debian --os-version=11 --mariadb-server-version="mariadb-10.5"
Upgrade PHPβ
Centreon 22.10 uses PHP in version 8.1.
- RHEL 8
- Alma / Oracle Linux 8
- CentOS 7
- Debian 11
You need to change the PHP stream from version 8.0 to 8.1 by executing the following commands and answering y to confirm:
dnf module reset php
dnf module install php:remi-8.1
You need to change the PHP stream from version 8.0 to 8.1 by executing the following commands and answering y to confirm:
dnf module reset php
dnf module install php:remi-8.1
You need to enable the php 8.1 repository
yum-config-manager --enable remi-php81
systemctl stop php8.0-fpm
Upgrade the Centreon solutionβ
Make sure all users are logged out from the Centreon web interface before starting the upgrade procedure.
If you have installed Business extensions, update the Business repository to version 22.10. Visit the support portal to get its address.
If your OS is Debian 11 and you have a customized Apache configuration, perform a backup of your configuration file (/etc/apache2/sites-available/centreon.conf).
Stop the Centreon Broker process:
systemctl stop cbd
Delete existing retention files:
rm /var/lib/centreon-broker/* -f
Clean yum cache:
- Alma / RHEL / Oracle Linux 8
- CentOS 7
- Debian 11
dnf clean all --enablerepo=*
yum clean all --enablerepo=*
apt clean
apt update
Then upgrade all the components with the following command:
- Alma / RHEL / Oracle Linux 8
- CentOS 7
- Debian 11
yum update centreon\* php-pecl-gnupg
yum update centreon\* php-pecl-gnupg
apt install --only-upgrade centreon
Accept new GPG keys from the repositories as needed.
Update your customized Apache configurationβ
This section only applies if you customized your Apache configuration.
- Alma / RHEL / Oracle Linux 8
- CentOS 7
- Debian 11
When upgrading your platform, the Apache configuration file is not upgraded automatically: the new configuration file brought by the rpm does not replace the old file. You must copy the changes manually to your customized configuration file.
Run a diff between the old and the new Apache configuration files:
diff -u /etc/httpd/conf.d/10-centreon.conf /etc/httpd/conf.d/10-centreon.conf.rpmnew
- 10-centreon.conf (post upgrade): this file contains the custom configuration. It does not contain anthing new brought by the upgrade.
- 10-centreon.conf.rpmnew (post upgrade): this file is provided by the rpm; it does not contain any custom configuration.
For each difference between the files, assess whether you should copy it from 10-centreon.conf.rpmnew to 10-centreon.conf.
Check that Apache is configured properly by running the following command:
apachectl configtest
The expected result is the following:
Syntax OK
Restart the Apache and PHP processes to take in account the new configuration:
systemctl restart php-fpm httpd
Then check its status:
systemctl status httpd
If everything is ok, you should have:
β 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 Tue 2020-10-27 12:49:42 GMT; 2h 35min ago
Docs: man:httpd.service(8)
Main PID: 1483 (httpd)
Status: "Total requests: 446; Idle/Busy workers 100/0;Requests/sec: 0.0479; Bytes served/sec: 443 B/sec"
Tasks: 278 (limit: 5032)
Memory: 39.6M
CGroup: /system.slice/httpd.service
ββ1483 /usr/sbin/httpd -DFOREGROUND
ββ1484 /usr/sbin/httpd -DFOREGROUND
ββ1485 /usr/sbin/httpd -DFOREGROUND
ββ1486 /usr/sbin/httpd -DFOREGROUND
ββ1487 /usr/sbin/httpd -DFOREGROUND
ββ1887 /usr/sbin/httpd -DFOREGROUND
When upgrading your platform, the Apache configuration file is not upgraded automatically: the new configuration file brought by the rpm does not replace the old file. You must copy the changes manually to your customized configuration file.
Run a diff between the old and the new Apache configuration files:
diff -u /opt/rh/httpd24/root/etc/httpd/conf.d/10-centreon.conf /opt/rh/httpd24/root/etc/httpd/conf.d/10-centreon.conf.rpmnew
- 10-centreon.conf (post upgrade): this file contains the custom configuration. It does not contain anthing new brought by the upgrade.
- 10-centreon.conf.rpmnew (post upgrade): this file is provided by the rpm; it does not contain any custom configuration.
For each difference between the files, assess whether you should copy it from 10-centreon.conf.rpmnew to 10-centreon.conf.
Check that Apache is configured properly by running the following command:
/opt/rh/httpd24/root/usr/sbin/apachectl configtest
The expected result is the following:
Syntax OK
Restart the Apache and PHP processes to take in account the new configuration:
systemctl restart php-fpm httpd24-httpd
Then check its status:
systemctl status httpd24-httpd
If everything is ok, you must have:
β httpd24-httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd24-httpd.service; enabled; vendor preset: disabled)
Active: active (running) since mar. 2020-05-12 15:39:58 CEST; 25min ago
Process: 31762 ExecStop=/opt/rh/httpd24/root/usr/sbin/httpd-scl-wrapper $OPTIONS -k graceful-stop (code=exited, status=0/SUCCESS)
Main PID: 31786 (httpd)
Status: "Total requests: 850; Idle/Busy workers 50/50;Requests/sec: 0.547; Bytes served/sec: 5.1KB/sec"
CGroup: /system.slice/httpd24-httpd.service
ββ 1219 /opt/rh/httpd24/root/usr/sbin/httpd -DFOREGROUND
ββ31786 /opt/rh/httpd24/root/usr/sbin/httpd -DFOREGROUND
ββ31788 /opt/rh/httpd24/root/usr/sbin/httpd -DFOREGROUND
ββ31789 /opt/rh/httpd24/root/usr/sbin/httpd -DFOREGROUND
ββ31790 /opt/rh/httpd24/root/usr/sbin/httpd -DFOREGROUND
ββ31802 /opt/rh/httpd24/root/usr/sbin/httpd -DFOREGROUND
ββ31865 /opt/rh/httpd24/root/usr/sbin/httpd -DFOREGROUND
ββ31866 /opt/rh/httpd24/root/usr/sbin/httpd -DFOREGROUND
ββ31882 /opt/rh/httpd24/root/usr/sbin/httpd -DFOREGROUND
ββ31903 /opt/rh/httpd24/root/usr/sbin/httpd -DFOREGROUND
ββ32050 /opt/rh/httpd24/root/usr/sbin/httpd -DFOREGROUND
Use the backup file you have created at the previous step to copy your customizations to file /etc/apache2/sites-available/centreon.conf.
Check that Apache is configured properly by running the following command:
apache2ctl configtest
The expected result is the following:
Syntax OK
Restart the Apache and PHP processes to take in account the new configuration:
systemctl restart php8.0-fpm apache2
Then check its status:
systemctl status apache2
If everything is ok, you must have:
β apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor pres>
Active: active (running) since Tue 2022-08-09 05:01:36 UTC; 3h 56min ago
Docs: https://httpd.apache.org/docs/2.4/
Main PID: 518 (apache2)
Tasks: 11 (limit: 2356)
Memory: 18.1M
CPU: 1.491s
CGroup: /system.slice/apache2.service
ββ 518 /usr/sbin/apache2 -k start
ββ1252 /usr/sbin/apache2 -k start
ββ1254 /usr/sbin/apache2 -k start
ββ1472 /usr/sbin/apache2 -k start
ββ3857 /usr/sbin/apache2 -k start
ββ3858 /usr/sbin/apache2 -k start
ββ3859 /usr/sbin/apache2 -k start
ββ3860 /usr/sbin/apache2 -k start
ββ3876 /usr/sbin/apache2 -k start
ββ6261 /usr/sbin/apache2 -k start
ββ6509 /usr/sbin/apache2 -k start
Customized Apache configuration: enable text compressionβ
In order to improve page loading speed, you can activate text compression on the Apache server. It requires the brotli package to work. This is optional but it provides a better user experience.
Add the following code to your Apache configuration file, in both the <VirtualHost *:80>
and <VirtualHost *:443>
elements:
<IfModule mod_brotli.c>
AddOutputFilterByType BROTLI_COMPRESS text/html text/plain text/xml text/css text/javascript application/javascript application/json
</IfModule>
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript application/json
Finalizing the upgradeβ
Before starting the web upgrade process, reload the Apache server with the following command:
- Alma / RHEL / Oracle Linux 8
- CentOS 7
- Debian 11
systemctl reload php-fpm httpd
systemctl reload php-fpm httpd24-httpd
apt autoremove
systemctl daemon-reload
systemctl stop php8.0-fpm.service
systemctl enable php8.1-fpm
systemctl start php8.1-fpm
systemctl restart apache2
Then you need to finalize the upgrade process:
- Using the wizard
- Using a dedicated API endpoint
Log on to the Centreon web interface to continue the update process. Click on Next:
Click on Next:
The release notes describe the main changes. Click on Next:
This process performs the various upgrades. Click on Next:
Your Centreon server is now up to date. Click on Finish to access the login page:
If the Centreon BAM module is installed, refer to the update procedure.
Deploy the central's configuration from the Centreon web UI by following this procedure.
Log on to the central server through your terminal to continue the update process.
You need an authentication token to reach the API endpoint. Perform the following procedure to get a token.
In our case, we have the configuration described below (you need to adapt the procedure to your configuration).
- address: 10.25.XX.XX
- port: 80
- version: 22.10
- login: Admin
- password: xxxxx
Enter the following request:
curl --location --request POST '10.25.XX.XX:80/centreon/api/v22.10/login' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
"security": {
"credentials": {
"login": "Admin",
"password": "xxxxx"
}
}
}'This is how the result should look like:
{"contact":{"id":1,"name":"Admin Centreon","alias":"admin","email":"admin@localhost","is_admin":true},"security":{"token":"hwwE7w/ukiiMce2lwhNi2mcFxLNYPhB9bYSKVP3xeTRUeN8FuGQms3RhpLreDX/S"}}
Retrieve the token number to use it in the next request.
Then enter this request:
curl --location --request PATCH 'http://10.25.XX.XX:80/centreon/api/latest/platform/updates' \
--header 'X-AUTH-TOKEN: hwwE7w/ukiiMce2lwhNi2mcFxLNYPhB9bYSKVP3xeTRUeN8FuGQms3RhpLreDX/S' \
--header 'Content-Type: application/json' \
--data '{
"components": [
{
"name": "centreon-web"
}
]
}'This request does not return any result. To check if the update has been successfully applied, read the version number displayed on the Centreon web interface login page.
Finally, restart Broker, Engine and Gorgone on the central server by running this command:
systemctl restart cbd centengine gorgoned
As the interface layout has changed in version 22.10, you need to clear your browser cache to display the new theme.
If the Centreon BAM module is installed, refer to the upgrade procedure.
Post-upgrade actionsβ
Upgrade extensions. From Administration > Extensions > Manager, upgrade all extensions, starting with the following:
License Manager,
Plugin Packs Manager,
Auto Discovery.
Then you can upgrade all other commercial extensions.
Restart the processes:
systemctl restart cbd centengine centreontrapd gorgoned
Upgrade the Remote Serversβ
This procedure is the same as for upgrading a Centreon Central server.
At the end of the update, configuration should be deployed from the Central server.
Upgrade the Pollersβ
Update the Centreon repositoryβ
Run the following 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
sed -i -E 's|[0-9]{2}\.[0-9]{2}|22.10|g' /etc/apt/sources.list.d/centreon.list
apt update
Upgrade the Centreon solutionβ
Clean yum cache:
- Alma / RHEL / Oracle Linux 8
- CentOS 7
- Debian 11
dnf clean all --enablerepo=*
yum clean all --enablerepo=*
apt clean
apt update
Then upgrade all the components with the following command:
- Alma / RHEL / Oracle Linux 8
- CentOS 7
- Debian 11
yum update centreon\*
yum update centreon\*
apt install --only-upgrade centreon-poller
Accept new GPG keys from the repositories as needed.
Restart centreon:
systemctl restart centreon