Upgrade Nagios xi 5.4.3 to 5.8 failed

This support forum board is for support questions relating to Nagios xi, our flagship commercial network monitoring solution.
efxSPN
Posts: 27
Joined: Tue Jun 15, 2021 5:46 am

Re: Upgrade Nagios xi 5.4.3 to 5.8 failed

Post by efxSPN »

Hello,

We are attachig again the output.



Thanks,
You do not have the required permissions to view the files attached to this post.
gsmith
Posts: 1253
Joined: Tue Mar 02, 2021 11:15 am

Re: Upgrade Nagios xi 5.4.3 to 5.8 failed

Post by gsmith »

Hi

Please run the following:

Code: Select all

alter table nagios_servicestatus modify output blob;
alter table nagios_servicestatus modify output text CHARACTER SET utf8 COLLATE utf8_unicode_ci not null;
And then try to start Nagios

Thanks
efxSPN
Posts: 27
Joined: Tue Jun 15, 2021 5:46 am

Re: Upgrade Nagios xi 5.4.3 to 5.8 failed

Post by efxSPN »

Hello,

We have executed SQL commands:

Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 173
Server version: 5.5.68-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [nagios]> alter table nagios_servicestatus modify output blob;
Query OK, 2328 rows affected (0.12 sec)
Records: 2328 Duplicates: 0 Warnings: 0

MariaDB [nagios]> alter table nagios_servicestatus modify output text CHARACTER SET utf8 COLLATE utf8_unicode_ci not null;
Query OK, 2328 rows affected (0.12 sec)
Records: 2328 Duplicates: 0 Warnings: 0

MariaDB [nagios]>


After restart the problem persist

[1624345099] Nagios 4.4.6 starting... (PID=8211)
[1624345099] Local time is Tue Jun 22 08:58:19 CEST 2021
[1624345099] LOG VERSION: 2.0
[1624345099] qh: Socket '/usr/local/nagios/var/rw/nagios.qh' successfully initialized
[1624345099] qh: core query handler registered
[1624345099] qh: echo service query handler registered
[1624345099] qh: help for the query handler registered
[1624345099] wproc: Successfully registered manager as @wproc with query handler
[1624345099] wproc: Registry request: name=Core Worker 8215;pid=8215
[1624345099] wproc: Registry request: name=Core Worker 8213;pid=8213
[1624345099] wproc: Registry request: name=Core Worker 8217;pid=8217
[1624345099] wproc: Registry request: name=Core Worker 8214;pid=8214
[1624345099] wproc: Registry request: name=Core Worker 8212;pid=8212
[1624345099] wproc: Registry request: name=Core Worker 8216;pid=8216
[1624345099] NDO-3: NDO 3.0.6RC1 (c) Copyright 2009-2020 Nagios - Nagios Core Development Team
[1624345099] NDO-3: Unable to prepare statement for query (27): Unknown column 'check_options' in 'field list'
[1624345099] NDO-3: Unable to prepare statement for query (28): Unknown column 'check_options' in 'field list'
[1624345099] NDO-3: Error preparing statements
[1624345099] NDO-3: Unable to prepare statement for query (27): Unknown column 'check_options' in 'field list'
[1624345099] NDO-3: Unable to prepare statement for query (28): Unknown column 'check_options' in 'field list'
[1624345099] NDO-3: Error preparing statements
[1624345099] NDO-3: Callbacks registered
[1624345099] NDO-3: Callbacks registered
[1624345099] Event broker module '/usr/local/nagios/bin/ndo.so' initialized successfully.
[1624345100] NDO-3: Unable to prepare statement for query (27): Unknown column 'check_options' in 'field list'
[1624345100] NDO-3: Unable to prepare statement for query (28): Unknown column 'check_options' in 'field list'
[1624345100] NDO-3: Error preparing statements
[1624345100] NDO-3: Started event_handler thread
[1624345100] NDO-3: Started timed_event thread
[1624345100] NDO-3: Started host_check thread
[1624345100] NDO-3: Started service_check thread
[1624345100] NDO-3: Started comment thread
[1624345100] NDO-3: Started downtime thread
[1624345100] NDO-3: Started flapping thread
[1624345100] NDO-3: Started host_status thread
[1624345100] NDO-3: Started service_status thread
[1624345100] NDO-3: Started contact_status thread
[1624345100] NDO-3: Started acknowledgement thread
[1624345100] NDO-3: Started notification thread
[1624345100] NDO-3: Started statechange thread
[1624345100] NDO-3: Unable to prepare statement for query (27): Unknown column 'check_options' in 'field list'
[1624345100] NDO-3: Unable to prepare statement for query (28): Unknown column 'check_options' in 'field list'
[1624345100] NDO-3: Unable to prepare statement for query (27): Unknown column 'check_options' in 'field list'
[1624345100] NDO-3: Unable to prepare statement for query (28): Unknown column 'check_options' in 'field list'
[1624345100] NDO-3: Error preparing statements
....
[1624345100] NDO-3: Error preparing statements
[1624345100] NDO-3: Ended contact_status thread
[1624345100] NDO-3: Ended host_check thread
[1624345100] NDO-3: ndo_return = 1 (Statement not prepared)
[1624345100] NDO-3: ndo_handle_host_status(ndo-handlers.c:985): Unable to bind parameters
[1624345100] NDO-3: Query failed in ndo_empty_queue_host_status
....

#########################################################################################################################
[root@nagios-ko ~]# systemctl status mariadb
● mariadb.service - MariaDB database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
Active: active (running) since Tue 2021-06-22 08:38:30 CEST; 11min ago
Main PID: 1306 (mysqld_safe)
CGroup: /system.slice/mariadb.service
├─1306 /bin/sh /usr/bin/mysqld_safe --basedir=/usr
└─1936 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --log-error=/var/log/mariadb/mariadb.log -...

Jun 22 08:38:27 nagios-ko systemd[1]: Starting MariaDB database server...
Jun 22 08:38:27 nagios-ko mariadb-prepare-db-dir[947]: Database MariaDB is probably initialized in /var/lib/mysql already, nothing is done.
Jun 22 08:38:27 nagios-ko mariadb-prepare-db-dir[947]: If this is not the case, make sure the /var/lib/mysql is empty before running mariadb-prepare-db-dir.
Jun 22 08:38:28 nagios-ko mysqld_safe[1306]: 210622 08:38:28 mysqld_safe Logging to '/var/log/mariadb/mariadb.log'.
Jun 22 08:38:28 nagios-ko mysqld_safe[1306]: 210622 08:38:28 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
Jun 22 08:38:30 nagios-ko systemd[1]: Started MariaDB database server.

#########################################################################################################################
[root@nagios-ko ~]# systemctl status nagios
● nagios.service - Nagios Core 4.4.6
Loaded: loaded (/usr/lib/systemd/system/nagios.service; enabled; vendor preset: disabled)
Active: active (running) since Tue 2021-06-22 08:43:58 CEST; 6min ago
Docs: https://www.nagios.org/documentation
Main PID: 4761 (nagios)
CGroup: /system.slice/nagios.service
├─ 4761 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
├─ 4762 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
├─ 4763 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
├─ 4764 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
├─ 4765 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
├─ 4766 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
├─ 4767 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
├─ 4995 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
... + alerts
Jun 22 08:43:58 nagios-ko nagios[4755]: Checked 0 service dependencies
Jun 22 08:43:58 nagios-ko nagios[4755]: Checked 0 host dependencies
Jun 22 08:43:58 nagios-ko nagios[4755]: Checked 24 timeperiods
Jun 22 08:43:58 nagios-ko nagios[4755]: Checking global event handlers...
Jun 22 08:43:58 nagios-ko nagios[4755]: Checking obsessive compulsive processor commands...
Jun 22 08:43:58 nagios-ko nagios[4755]: Checking misc settings...
Jun 22 08:43:58 nagios-ko nagios[4755]: Total Warnings: 12
Jun 22 08:43:58 nagios-ko nagios[4755]: Total Errors: 0
Jun 22 08:43:58 nagios-ko nagios[4755]: Things look okay - No serious problems were detected during the pre-flight check
Jun 22 08:43:58 nagios-ko systemd[1]: Started Nagios Core 4.4.6.
[root@nagios-ko ~]# systemctl status nagiosxi
● nagiosxi.service - SYSV: Nagiosxi subtasks
Loaded: loaded (/etc/rc.d/init.d/nagiosxi; bad; vendor preset: disabled)
Active: active (exited) since Tue 2021-06-22 08:45:26 CEST; 5min ago
Docs: man:systemd-sysv-generator(8)
Process: 8720 ExecStop=/etc/rc.d/init.d/nagiosxi stop (code=exited, status=0/SUCCESS)
Process: 8723 ExecStart=/etc/rc.d/init.d/nagiosxi start (code=exited, status=0/SUCCESS)

Jun 22 08:45:26 nagios-ko systemd[1]: Stopped SYSV: Nagiosxi subtasks.
Jun 22 08:45:26 nagios-ko systemd[1]: Starting SYSV: Nagiosxi subtasks...
Jun 22 08:45:26 nagios-ko systemd[1]: Started SYSV: Nagiosxi subtasks.
You have mail in /var/spool/mail/root
[root@nagios-ko ~]#

#########################################################################################################################

[root@nagios-ko ~]# systemctl -a | grep nagios
nagios.service loaded active running Nagios Core 4.4.6
nagiosxi.service loaded active exited SYSV: Nagiosxi subtasks
[root@nagios-ko ~]#


thanks in advance,
A.Rubio
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Upgrade Nagios xi 5.4.3 to 5.8 failed

Post by ssax »

[1624345100] NDO-3: Unable to prepare statement for query (27): Unknown column 'check_options' in 'field list'
Please do this:
- NOTE: You may need to adjust the -h 127.0.0.1, the -uroot, and -pnagiosxi in the command if your DB is contained/stored on another server and/or you've changed the root mysql password

Code: Select all

mysql -h 127.0.0.1 -uroot -pnagiosxi nagios -e "ALTER TABLE nagios_hoststatus ADD check_options smallint(6) NOT NULL default '0' AFTER check_type;"
mysql -h 127.0.0.1 -uroot -pnagiosxi nagios -e "ALTER TABLE nagios_servicestatus ADD check_options smallint(6) NOT NULL default '0' AFTER check_type;"
systemctl restart nagios
See if that helps.
efxSPN
Posts: 27
Joined: Tue Jun 15, 2021 5:46 am

Re: Upgrade Nagios xi 5.4.3 to 5.8 failed

Post by efxSPN »

Hello,


the problem persits:

[root@nagios-ko ~]# mysql -h 127.0.0.1 -uroot -pnagiosxi nagios -e "ALTER TABLE nagios_hoststatus ADD check_options smallint(6) NOT NULL default '0' AFTER check_type;"
[root@nagios-ko ~]# mysql -h 127.0.0.1 -uroot -pnagiosxi nagios -e "ALTER TABLE nagios_servicestatus ADD check_options smallint(6) NOT NULL default '0' AFTER check_type;"
[root@nagios-ko ~]# systemctl restart nagios
[root@nagios-ko ~]#


nagios.log
[1624389279] Nagios 4.4.6 starting... (PID=7071)
[1624389279] Local time is Tue Jun 22 21:14:39 CEST 2021
[1624389279] LOG VERSION: 2.0
[1624389279] qh: Socket '/usr/local/nagios/var/rw/nagios.qh' successfully initialized
[1624389279] qh: core query handler registered
[1624389279] qh: echo service query handler registered
[1624389279] qh: help for the query handler registered
[1624389279] wproc: Successfully registered manager as @wproc with query handler
[1624389279] wproc: Registry request: name=Core Worker 7076;pid=7076
[1624389279] wproc: Registry request: name=Core Worker 7074;pid=7074
[1624389279] wproc: Registry request: name=Core Worker 7077;pid=7077
[1624389279] wproc: Registry request: name=Core Worker 7072;pid=7072
[1624389279] wproc: Registry request: name=Core Worker 7075;pid=7075
[1624389279] wproc: Registry request: name=Core Worker 7073;pid=7073
[1624389279] NDO-3: NDO 3.0.6RC1 (c) Copyright 2009-2020 Nagios - Nagios Core Development Team
[1624389279] NDO-3: Callbacks registered
[1624389279] NDO-3: Callbacks registered
[1624389279] Event broker module '/usr/local/nagios/bin/ndo.so' initialized successfully.
[1624389280] NDO-3: Started timed_event thread
[1624389280] NDO-3: Started event_handler thread
[1624389280] NDO-3: Started host_check thread
[1624389280] NDO-3: Started service_check thread
[1624389280] NDO-3: Started comment thread
[1624389280] NDO-3: Started downtime thread
[1624389280] NDO-3: Started flapping thread
[1624389280] NDO-3: Started host_status thread
[1624389280] NDO-3: Started service_status thread
[1624389280] NDO-3: Started acknowledgement thread
[1624389280] NDO-3: Started contact_status thread
[1624389280] NDO-3: Started notification thread
[1624389280] NDO-3: Started statechange thread
[1624389280] NDO-3: Ended contact_status thread
[1624389280] NDO-3: Ended host_check thread
[1624389281] NDO-3: Ended host_status thread
[1624389286] Successfully launched command file worker with pid 7203
[1624389290] NDO-3: Ended acknowledgement thread
[1624389290] NDO-3: Ended statechange thread
[1624389290] NDO-3: Ended downtime thread
[1624389290] NDO-3: Ended notification thread
[1624389290] NDO-3: Ended event_handler thread
[1624389290] NDO-3: Ended flapping thread
[1624389290] NDO-3: Ended comment thread
[1624389290] NDO-3: Ended service_check thread
[1624389290] NDO-3: Ended timed_event thread
[1624389293] NDO-3: Ended service_status thread
[root@nagios-ko var]#



[root@nagios-ko var]# systemctl status nagiosxi
● nagiosxi.service - SYSV: Nagiosxi subtasks
Loaded: loaded (/etc/rc.d/init.d/nagiosxi; bad; vendor preset: disabled)
Active: active (exited) since Tue 2021-06-22 21:12:29 CEST; 5min ago
Docs: man:systemd-sysv-generator(8)
Process: 1028 ExecStart=/etc/rc.d/init.d/nagiosxi start (code=exited, status=0/SUCCESS)

Jun 22 21:12:29 nagios-ko systemd[1]: Starting SYSV: Nagiosxi subtasks...
Jun 22 21:12:29 nagios-ko systemd[1]: Started SYSV: Nagiosxi subtasks.
You have mail in /var/spool/mail/root
[root@nagios-ko var]# systemctl status nagios
● nagios.service - Nagios Core 4.4.6
Loaded: loaded (/usr/lib/systemd/system/nagios.service; enabled; vendor preset: disabled)
Active: active (running) since Tue 2021-06-22 21:14:39 CEST; 3min 28s ago
Docs: https://www.nagios.org/documentation
Process: 6841 ExecStopPost=/bin/rm -f /usr/local/nagios/var/rw/nagios.cmd (code=exited, status=0/SUCCESS)
Process: 6838 ExecStop=/bin/kill -s TERM ${MAINPID} (code=exited, status=0/SUCCESS)
Process: 7069 ExecStart=/usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg (code=exited, status=0/SUCCESS)
Process: 7061 ExecStartPre=/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg (code=exited, status=0/SUCCESS)
Main PID: 7071 (nagios)
CGroup: /system.slice/nagios.service
├─ 7071 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
├─ 7072 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
├─ 7073 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
├─ 7074 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
├─ 7075 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
├─ 7076 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
├─ 7077 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
├─ 7203 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg

Jun 22 21:14:39 nagios-ko nagios[7061]: Checked 0 service dependencies
Jun 22 21:14:39 nagios-ko nagios[7061]: Checked 0 host dependencies
Jun 22 21:14:39 nagios-ko nagios[7061]: Checked 24 timeperiods
Jun 22 21:14:39 nagios-ko nagios[7061]: Checking global event handlers...
Jun 22 21:14:39 nagios-ko nagios[7061]: Checking obsessive compulsive processor commands...
Jun 22 21:14:39 nagios-ko nagios[7061]: Checking misc settings...
Jun 22 21:14:39 nagios-ko nagios[7061]: Total Warnings: 12
Jun 22 21:14:39 nagios-ko nagios[7061]: Total Errors: 0
Jun 22 21:14:39 nagios-ko nagios[7061]: Things look okay - No serious problems were detected during the pre-flight check
Jun 22 21:14:39 nagios-ko systemd[1]: Started Nagios Core 4.4.6.
[root@nagios-ko var]#


[root@nagios-ko var]# systemctl -a | grep nagios
nagios.service loaded active running Nagios Core 4.4.6
nagiosxi.service loaded active exited SYSV: Nagiosxi subtasks
[root@nagios-ko var]#


Thanks in advance,
A. Rubio
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Upgrade Nagios xi 5.4.3 to 5.8 failed

Post by ssax »

The nagiosxi service is old and shouldn't exist anymore. You can remove that:

Code: Select all

systemctl stop nagiosxi
systemctl disable nagiosxi
rm /etc/init.d/nagiosxi
systemctl daemon-reload
It looks like it's working from that output (other than the old nagiosxi service that is no longer used). Please PM me a copy of your profile.zip from Admin > System Profile.

PM me this file as well:

Code: Select all

/usr/local/nagios/var/nagios.log
efxSPN
Posts: 27
Joined: Tue Jun 15, 2021 5:46 am

Re: Upgrade Nagios xi 5.4.3 to 5.8 failed

Post by efxSPN »

Hello,

We have removed nagiosxi service.

We are just attaching profile.zip and nagios.log.
You do not have the required permissions to view the files attached to this post.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Upgrade Nagios xi 5.4.3 to 5.8 failed

Post by ssax »

What is the output of this command?

Code: Select all

rpm -qa | grep nagiosxi
If you see a nagiosxi-5.6.14 package in there, you likely need to upgrade via:

Code: Select all

yum upgrade nagiosxi
Or with the offline package:

https://repo.nagios.com/?repo=offline

If you don't see nagiosxi-5.6.14 package in there, run these commands as root:

Code: Select all

cd /tmp
rm -rf /tmp/nagiosxi
wget https://assets.nagios.com/downloads/nagiosxi/5/xi-5.8.4.tar.gz
tar zxf xi-5.8.4.tar.gz
cd nagiosxi
./upgrade
Then send entire upgrade.log from /tmp/nagiosxi and any errors you see on the screen.
efxSPN
Posts: 27
Joined: Tue Jun 15, 2021 5:46 am

Re: Upgrade Nagios xi 5.4.3 to 5.8 failed

Post by efxSPN »

Hello,

We have nagiosxi-5.8.4-1.el7.x86_64 version:

[root@nagios-ko ~]# rpm -qa | grep nagiosxi
nagiosxi-nrds-5.8.4-1.el7.x86_64
nagiosxi-5.8.4-1.el7.x86_64
nagiosxi-ajaxterm-5-4.3.el7.x86_64
nagiosxi-nsca-5.8.4-1.el7.x86_64
nagiosxi-wmic-5.8.4-1.el7.x86_64
nagiosxi-ndoutils-5.8.4-1.el7.x86_64
nagiosxi-wkhtmltox-5.8.4-1.el7.x86_64
nagiosxi-shellinabox-5.8.4-1.el7.x86_64
nagiosxi-nxti-5.8.4-1.el7.x86_64
nagiosxi-nrpe-5.8.4-1.el7.x86_64
nagiosxi-nagiosplugins-5.8.4-1.el7.x86_64
nagiosxi-mrtg-5.8.4-1.el7.x86_64
nagiosxi-nagioscore-5.8.4-1.el7.x86_64
nagiosxi-nagiosql-5-4.3.el7.x86_64
[root@nagios-ko ~]#


Thanks in advance,
A.Rubio
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Upgrade Nagios xi 5.4.3 to 5.8 failed

Post by ssax »

Your profile show's you're still on xi 5.4.3. Does the web interface show 5.4.3?

If the xi web interface still shows 5.4.3, you'll need to do this to get the backend nagiosxi file to match what the RPMs show as the version:

Download this file to your /tmp directory of your xi server:

https://repo.nagios.com/nagiosxi-offlin ... _64.tar.gz

Then as root, run these commands on your xi server:

Code: Select all

cd /tmp
rm -rf nagiosxi
tar zxf nagiosxi-5.8.4-1.el7.x86_64.tar.gz
mv nagiosxi nag
cd nag
rpm2cpio nagiosxi-5.8.4-1.el7.x86_64.rpm | cpio -idmv
cd tmp/nagiosxi
./rpmupgrade
Then restart the nagios service and apply configuration.

If it fails, send us the full output of all the commands and this file:

Code: Select all

/tmp/xi-upgrade.log