Page 1 of 1
Upgrading NagiosXI 5.5.9 to PHP 7.2
Posted: Wed Jan 30, 2019 11:40 am
by trea
Apologies in advance if this is answered somewhere else; I wasn't able to find an answer that seemed definitive.
We're running CentOS 7, NagiosXI 5.5.9, PHP 5.4.16. We'd like to upgrade to PHP7.2, to take advantage of the performance and security benefits in newer versions of PHP. That being said when we attempt the upgrade we have the following errors during the update:
Code: Select all
$ yum update php*
Error: Package: nagiosxi-deps-el7-5.5.7-1.noarch (installed)
Requires: php-mssql
Removing: php-mssql-5.4.16-7.el7.x86_64 (@epel)
php-mssql = 5.4.16-7.el7
Obsoleted By: php-pdo-dblib-7.2.13-2.el7.remi.x86_64 (prod-centos-7-x86_64-remi-php72::yum)
Not found
I'm not really clear on how best to resolve this dependency problem - someone suggested manually hacking the nagiosxi-deps package to force it to not insist on this dependency chain, but I wasn't having much luck. Is it Nagios' official position that 7.2 is supported in the newest versions of XI, or should we hold off? Any advice would be appreciated.
Re: Upgrading NagiosXI 5.5.9 to PHP 7.2
Posted: Wed Jan 30, 2019 3:30 pm
by npolovenko
@trea, Let's check the reason for the dependency problem first. Please run the following commands on your server and show me the output.
yum repolist
yum list installed | grep php
As far as upgrading the PHP. It is possible to install php 7.2 on CentOS7 but we haven't officially tested it. So before you upgrade please backup your XI or take a snapshot of the VM.
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY*
yum -y install epel-release
rpm -Uvh
http://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum -y install yum-utils
yum -y remove php*
yum-config-manager --enable remi-php72
yum -y install php php-opcache php-devel php-gd php-ldap php-mbstring php-pdo php-mysqlnd php-pgsql php-pear php-pecl-ssh2 php-pgsql php-process php-snmp php-xml
cd /tmp
rm -rf /tmp/nagiosxi
wget
https://assets.nagios.com/downloads/nag ... 5.9.tar.gz
tar zxf xi-5.5.9.tar.gz
cd /tmp/nagiosxi
rm -rf /etc/php.d/sourceguardian.ini
./init.sh
sed -i '/^PHP script/d' xi-sys.cfg
sed -i '/^1)/d' xi-sys.cfg
sed -i '/^2)/d' xi-sys.cfg
sed -i '/^3)/d' xi-sys.cfg
./install-sourceguardian-extension.sh
service httpd restart
Re: Upgrading NagiosXI 5.5.9 to PHP 7.2
Posted: Wed Jan 30, 2019 5:13 pm
by trea
Here's the information you requested:
Code: Select all
$ yum repolist
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
repo id repo name status
nagios-base Nagios 91
nagiosxi-deps Nagios XI Dependencies 29
prod-centos-7-x86_64-base::yum prod-centos-7-x86_64-base::yum 20,171
prod-centos-7-x86_64-centosplus::yum prod-centos-7-x86_64-centosplus::yum 305
prod-centos-7-x86_64-epel::yum prod-centos-7-x86_64-epel::yum 25,793
prod-centos-7-x86_64-extras::yum prod-centos-7-x86_64-extras::yum 785
prod-centos-7-x86_64-updates::yum prod-centos-7-x86_64-updates::yum 6,741
repolist: 53,915
Code: Select all
$ yum list installed | grep php
php.x86_64 5.4.16-46.el7 @prod-centos-7-x86_64-base::yum
php-cli.x86_64 5.4.16-46.el7 @prod-centos-7-x86_64-base::yum
php-common.x86_64 5.4.16-46.el7 @prod-centos-7-x86_64-base::yum
php-devel.x86_64 5.4.16-46.el7 @prod-centos-7-x86_64-base::yum
php-gd.x86_64 5.4.16-46.el7 @prod-centos-7-x86_64-base::yum
php-ldap.x86_64 5.4.16-46.el7 @prod-centos-7-x86_64-base::yum
php-mbstring.x86_64 5.4.16-46.el7 @prod-centos-7-x86_64-base::yum
php-mssql.x86_64 5.4.16-7.el7 @epel
php-mysql.x86_64 5.4.16-46.el7 @prod-centos-7-x86_64-base::yum
php-pdo.x86_64 5.4.16-46.el7 @prod-centos-7-x86_64-base::yum
php-pear.noarch 1:1.9.4-21.el7 @prod-centos-7-x86_64-base
php-pecl-ssh2.x86_64 0.12-1.el7 @epel
php-pgsql.x86_64 5.4.16-46.el7 @prod-centos-7-x86_64-base::yum
php-process.x86_64 5.4.16-46.el7 @prod-centos-7-x86_64-base::yum
php-snmp.x86_64 5.4.16-46.el7 @prod-centos-7-x86_64-base::yum
php-xml.x86_64 5.4.16-46.el7 @prod-centos-7-x86_64-base::yum
I've successfully upgraded PHP7 on other CentOS systems; I just meant specifically if NagiosXI is supported with this configuration, and it sounds like it is potentially. For what it's worth we installed NagiosXI by following the Knowledge Base Article:
https://assets.nagios.com/downloads/nag ... -Linux.pdf
Re: Upgrading NagiosXI 5.5.9 to PHP 7.2
Posted: Wed Jan 30, 2019 5:56 pm
by npolovenko
@trea, Looks like your system is trying to install the package -> php-pdo-dblib-7.2.13-2.el7.remi.x86_64 from the prod-centos-7-x86_64-remi-php72::yum repository, but its failing because you disabled the repo. It also thinks that php-mssql package needs to be replaced by the one in the remi repo.
Nagios XI should work with PHP 7.2 if you install it properly and replace the sourceguardian module. Currently, I don't have a solution for the package conflict between the package in your custom repo and the php-mssql. But the upgrade instructions I posted earlier worked for me in the lab and did not produce dependency issues.
Re: Upgrading NagiosXI 5.5.9 to PHP 7.2
Posted: Thu Jan 31, 2019 10:27 am
by trea
Thanks, but i'd rather avoid making custom changes to my installation which will only make it harder to support in future upgrades.
@npolovenko, do you have a timetable for when the Nagios install script will depend on PHP7x to be installed? It seems like a concerted effort is being made in the PHP community to underscore that 5.6 and below are now EOL, and the large number of public-facing servers on the internet that continue to have these unsupported versions of PHP installed.
The fact that this has been coming is no secret, so I'm curious what Nagios' timetable is for getting their installers up to parity on these newer versions.
Re: Upgrading NagiosXI 5.5.9 to PHP 7.2
Posted: Thu Jan 31, 2019 11:10 am
by mcapra
trea wrote:The fact that this has been coming is no secret, so I'm curious what Nagios' timetable is for getting their installers up to parity on these newer versions.
The blocker has historically been that RHEL/CentOS 7.x offers no PHP 7.x packages in their base repositories. The Red Hat pattern is one of
backporting important security fixes and generally letting things sit otherwise (stability being the priority). There are a good chunk of Nagios XI customers who simply cannot allow third-party repositories (like
Remi's,
Webtatic, etc) as a matter of organizational policy.
All that said, I am also interested in the answer to this question

This sort of question is certainly not new.
Re: Upgrading NagiosXI 5.5.9 to PHP 7.2
Posted: Thu Jan 31, 2019 12:23 pm
by scottwilkerson
trea wrote:@npolovenko, do you have a timetable for when the Nagios install script will depend on PHP7x to be installed?
As
@mcapra pointed out, Nagios XI will depend on them when they are included in the base repositories for the OS.
So, it looks like CentOS/RHEL 8 will have PHP 7.2 when it is finally released.