Page 1 of 1

Upgrade fails with custom named Database.

Posted: Mon Jan 19, 2015 11:04 am
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

Re: Upgrade fails with custom named Database.

Posted: Mon Jan 19, 2015 11:59 am
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

Re: Upgrade fails with custom named Database.

Posted: Mon Jan 19, 2015 12:47 pm
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.