Upgrading NagiosXI 5.5.9 to PHP 7.2

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
trea
Posts: 6
Joined: Thu Dec 06, 2018 2:16 pm

Upgrading NagiosXI 5.5.9 to PHP 7.2

Post 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.
You do not have the required permissions to view the files attached to this post.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Upgrading NagiosXI 5.5.9 to PHP 7.2

Post 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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
trea
Posts: 6
Joined: Thu Dec 06, 2018 2:16 pm

Re: Upgrading NagiosXI 5.5.9 to PHP 7.2

Post 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
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Upgrading NagiosXI 5.5.9 to PHP 7.2

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
trea
Posts: 6
Joined: Thu Dec 06, 2018 2:16 pm

Re: Upgrading NagiosXI 5.5.9 to PHP 7.2

Post 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.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Upgrading NagiosXI 5.5.9 to PHP 7.2

Post 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.
Former Nagios employee
https://www.mcapra.com/
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Upgrading NagiosXI 5.5.9 to PHP 7.2

Post 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.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked