Upgrade fails with custom named Database.

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
TBT
Posts: 625
Joined: Wed May 18, 2011 1:26 pm

Upgrade fails with custom named Database.

Post by TBT »

Each of our Nagios XI servers utilize an offloaded MySQL Database with a unique name. Upgrading (both manually and via web interface) fails due in part to custom naming conventions aren't being taken into consideration or checked against primary config when upgrade scripts are ran. Shown in the screenshot below, database 'nagios' is assumed.
XI-upgrade-fail.PNG
You do not have the required permissions to view the files attached to this post.
Nagios XI 2024R2.2.1 (8 Servers)
Nagios Fusion 2024R1.0.2
pnnagios
Posts: 47
Joined: Wed Dec 14, 2011 9:48 am

Re: Upgrade fails with custom named Database.

Post by pnnagios »

The problem was found to be the file "verify_upgraded_ndo.sql" from the upgrade package. The first line in the file is "Use nagios;", making the assumption that the database is named "nagios". As my associate mentioned in the previous post, we have several NagiosXI servers, sharing a common off-loaded mysql database, and each host has its own uniquely named database instance. We have run into this issue before, with the upgrade scripts, and it would be nice if the database name could be read from the configuration file, instead of being hard coded to "nagios".

Thank you,

Paul
cmerchant
Posts: 546
Joined: Wed Sep 24, 2014 11:19 am

Re: Upgrade fails with custom named Database.

Post by cmerchant »

It seems we are almost half-way there. The upgrade script that invokes the mysql cmd, already has the --database=$cfg__db_info__ndoutils__db parameter, but like you said it hard codes the use nagios statement, OVERRIDING the command line database parameter. I spoke with the developers and they are going to fix that with the next upgrade.

You should be able to remove the "USE nagios;" statement out of that file you discovered verify_upgraded_ndo.sql, and the upgrade script should work.
Locked