Page 1 of 1

Upgrade from 5.10.0 to 5.11.1

Posted: Thu Sep 14, 2023 5:14 am
by scookpfs
We trying to upgrade our Nagios XI from 5.10.0 to 5.11.1, running on CentOS 7, but it's failling at importing the CCM. We've had this install running for many a few years, and not seen this before. Is there a simple explanation?

Done!
INSTALL: Wizards installed/updated OK.
no crontab for nagios
no crontab for root
Copying over new XI directory...
Installing new PNP templates...
Enabling large install tweaks...
Fixing config file permissions...
Fixing htpasswd permissions...
Checking group memberships...
Installing new XI templates...

--- reset_config_perms.sh ------------
> Setting script permissions
> Setting CCM script permissions
> Setting special script permissions
> Setting special component script permissions
> Setting migrate permissions
> Setting configuration file/directory permissions
> Setting perfdata directory and RRD permissions
> Setting libexec directory permissions
> Setting Nagios XI config permissions
> Setting NOM checkpoint user:group permissions
> + Setting Nagios Core corelog.newobjects user:group permissions
> + Setting CCM configuration file user:group permissions
> + Setting Recurring Downtime file user:group permissions
> + Setting BPI configuration file user:group permissions
--------------------------------------
PHP Warning: Trying to access array offset on value of type null in /usr/local/nagiosxi/html/includes/utils.inc.php on line 1070
PHP Warning: Trying to access array offset on value of type null in /usr/local/nagiosxi/html/includes/utils.inc.php on line 1070
PHP Fatal error: Uncaught mysqli_sql_exception: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE name='im_component_version'' at line 1 in /usr/local/nagiosxi/html/db/adodb/drivers/adodb-mysqli.inc.php:788
Stack trace:
#0 /usr/local/nagiosxi/html/db/adodb/drivers/adodb-mysqli.inc.php(788): mysqli_query()
#1 /usr/local/nagiosxi/html/db/adodb/adodb.inc.php(1268): ADODB_mysqli->_query()
#2 /usr/local/nagiosxi/html/db/adodb/adodb.inc.php(1246): ADOConnection->_Execute()
#3 /usr/local/nagiosxi/html/includes/db.inc.php(534): ADOConnection->Execute()
#4 /usr/local/nagiosxi/html/includes/utils.inc.php(1071): exec_sql_query()
#5 /usr/local/nagiosxi/html/includes/components/nagiosim/nagiosim.inc.php(545): set_option()
#6 /usr/local/nagiosxi/html/includes/components/nagiosim/nagiosim.inc.php(106): nagiosim_db_init()
#7 /usr/local/nagiosxi/html/includes/components/nagiosim/nagiosim.inc.php(19): nagiosim_component_init()
#8 /usr/local/nagiosxi/html/includes/components.inc.php(30): include_once('/usr/local/nagi...')
#9 /usr/local/nagiosxi/html/includes/pageparts.inc.php(9): include_once('/usr/local/nagi...')
#10 /usr/local/nagiosxi/html/includes/common.inc.php(11): require_once('/usr/local/nagi...')
#11 /usr/local/nagiosxi/html/includes/utils-banner_message.inc.php(2): require_once('/usr/local/nagi...')
#12 /usr/local/nagiosxi/html/includes/utils.inc.php(56): require_once('/usr/local/nagi...')
#13 /usr/local/nagiosxi/html/includes/dbauth.inc.php(11): require_once('/usr/local/nagi...')
#14 /usr/local/nagiosxi/html/includes/dbauth.inc.php(2): sg_load()
#15 /usr/local/nagiosxi/html/includes/db.inc.php(11): require_once('/usr/local/nagi...')
#16 /usr/local/nagiosxi/html/config.inc.php(212): require_once('/usr/local/nagi...')
#17 /usr/local/nagiosxi/scripts/ccm_import.php(12): require_once('/usr/local/nagi...')
#18 {main}
thrown in /usr/local/nagiosxi/html/db/adodb/drivers/adodb-mysqli.inc.php on line 788

Importing into the CCM failed!







We're using the following

[root@xxxxnagios02 ~]# yum list installed | grep php
gd3php.x86_64 2.3.3-7.el7.remi @remi-safe
oniguruma5php.x86_64 6.9.8-1.el7.remi @remi-safe
php.x86_64 8.1.23-1.el7.remi @centos7_php81
php-cli.x86_64 8.1.23-1.el7.remi @centos7_php81
php-common.x86_64 8.1.23-1.el7.remi @centos7_php81
php-devel.x86_64 8.1.23-1.el7.remi @centos7_php81
php-gd.x86_64 8.1.23-1.el7.remi @centos7_php81
php-imap.x86_64 8.1.23-1.el7.remi @centos7_php81
php-ldap.x86_64 8.1.23-1.el7.remi @centos7_php81
php-mbstring.x86_64 8.1.23-1.el7.remi @centos7_php81
php-mysqlnd.x86_64 8.1.23-1.el7.remi @centos7_php81
php-odbc.x86_64 8.1.23-1.el7.remi @centos7_php81
php-opcache.x86_64 8.1.23-1.el7.remi @centos7_php81
php-pdo.x86_64 8.1.23-1.el7.remi @centos7_php81
php-pdo-dblib.x86_64 8.1.23-1.el7.remi @centos7_php81
php-pear.noarch 1:1.10.13-5.el7.remi @php74
php-pecl-ssh2.x86_64 1.4-2.el7.remi.8.1 @centos7_php81
php-pgsql.x86_64 8.1.23-1.el7.remi @centos7_php81
php-process.x86_64 8.1.23-1.el7.remi @centos7_php81
php-snmp.x86_64 8.1.23-1.el7.remi @centos7_php81
php-sodium.x86_64 8.1.23-1.el7.remi @centos7_php81
php-xml.x86_64 8.1.23-1.el7.remi @centos7_php81

[root@xxxxnagios02 ~]# yum list installed | grep mysql
mysql-community-client.x86_64 5.7.43-1.el7 @mysql_centos7_community57
mysql-community-common.x86_64 5.7.43-1.el7 @mysql_centos7_community57
mysql-community-devel.x86_64 5.7.43-1.el7 @mysql_centos7_community57
mysql-community-libs.x86_64 5.7.43-1.el7 @mysql_centos7_community57
mysql-community-libs-compat.x86_64 5.7.43-1.el7 @mysql_centos7_community57
mysql-community-server.x86_64 5.7.43-1.el7 @mysql_centos7_community57
php-mysqlnd.x86_64 8.1.23-1.el7.remi @centos7_php81

Re: Upgrade from 5.10.0 to 5.11.1

Posted: Thu Sep 14, 2023 11:09 am
by sgardil
Hey @scookpfs thanks for reaching out.

Reading through the stack trace it looks like you have the Nagios Incident Manager component which is discontinued. It has been known to throw errors in the database. One solution may be to remove NagiosIM and attempt the upgrade again. If you want to attempt this solution make sure to take a snapshot before altering the files and then to test it you can run this command so that the NagiosIM component doesnt conflict with the install:
mv /usr/local/nagiosxi/html/includes/components/nagiosim /root

Re: Upgrade from 5.10.0 to 5.11.1

Posted: Tue Sep 19, 2023 6:28 am
by scookpfs
Thanks, I'll give that a shot.

Re: Upgrade from 5.10.0 to 5.11.1

Posted: Wed Sep 27, 2023 5:41 am
by scookpfs
Removing the nagiosim worked, and I've just upgraded to 5.11.2.

But the upgrade our file age checks, complaing that
You must specify files to check on with '-F'
I compared the new command to one from a backup taken moments before the upgrade, and the new one is definately broken. Reverting the command fixed the issue.

### old ###

Code: Select all

define command {
    command_name    check_file_size_age
    command_line    $USER1$/folder_watch.pl -D $ARG1$ -F $ARG2$ $ARG3$ $ARG4$ $ARG5$
}
### new ###

Code: Select all

define command {
    command_name    check_file_size_age
    command_line    $USER1$/folder_watch.pl $ARG1$ $ARG2$ -f
}
This would suggest an issue with the commands.cfg file released in one of the recent patches.

I got a hint at the problem from another post with the same issue viewtopic.php?p=345418#p345418

Re: Upgrade from 5.10.0 to 5.11.1

Posted: Wed Sep 27, 2023 9:16 am
by sgardil
Glad to hear that this fixed the upgrade path for you. Thanks for letting us know about this issue with the command changing on upgrade, I will look into it and see if I can find the issue.

Re: Upgrade from 5.10.0 to 5.11.1

Posted: Wed Oct 04, 2023 2:37 am
by nicklesta
Hisnow rider 3d
Is this issue solved?

Re: Upgrade from 5.10.0 to 5.11.1

Posted: Wed Oct 04, 2023 9:35 am
by sgardil
Hey @nicklesta

I believe the issue has been resolved from the sounds of it. Are you having similar issues?