Page 1 of 1

MYSQL Database Issue with Bulk Modifications Tool

Posted: Thu Feb 02, 2017 3:21 pm
by pnnagios
Hello,

We are experiencing an issue with the Bulk Modifications Tool, that produces an SQL error as seen in the image below:
BMT_Error_1.PNG
We are using several NagiosXI (version 5.3.3) instances with a remote database server, along with separate database instances each of which has a non-default name. From our troubleshooting it seems as if the PHP code for this tool uses an assumed database name of nagiosql, and our database names are different. We were able to clear the error from the page, by removing the explicit database name from the following SELECT lines in /usr/local/nagiosxi/includes/components/bulkmodifications/bulkmodifications.inc.php,

$hostgroups = exec_sql_query(DB_NAGIOSQL, "SELECT `hostgroup_name` as `id`,`hostgroup_name`,`alias` FROM nagiosql.tbl_hostgroup ORDER BY `hostgroup_name`;", true);
$servicegroups = exec_sql_query(DB_NAGIOSQL, "SELECT `servicegroup_name` as `id`,`servicegroup_name`,`alias` FROM nagiosql.tbl_servicegroup ORDER BY `servicegroup_name`;", true);

However we are not sure if this is the best fix. Perhaps it is better to read the database name from the /usr/local/nagiosxi/html/config.inc.php for the SELECT statement, just as it does for the connection information.

Thank you,

Paul

Re: MYSQL Database Issue with Bulk Modifications Tool

Posted: Thu Feb 02, 2017 3:32 pm
by rkennedy
Thank you for letting us know. Obviously, you changing the hard coded nagiosql db name will fix it, but I agree with you - it should respect config.inc.php. I was able to verify things on my end, and submit a bug report for this.

Code: Select all

NEW TASK ID 10936 created - Nagios XI Bug Report: Bulk Mod Tool uses hardcoded nagiosql and not config.inc.php

Re: MYSQL Database Issue with Bulk Modifications Tool

Posted: Thu Feb 02, 2017 4:37 pm
by pnnagios
Sounds good. Hopefully, this will be fixed in a future release.

Re: MYSQL Database Issue with Bulk Modifications Tool

Posted: Thu Feb 02, 2017 4:40 pm
by dwhitfield
5.4.2 should be released next week. I don't know if it will make it in, but you can always check out https://assets.nagios.com/downloads/nag ... NGES-5.TXT

For now, is there anything more we can do for you, or should we lock the thread?

Re: MYSQL Database Issue with Bulk Modifications Tool

Posted: Fri Feb 03, 2017 8:18 am
by pnnagios
All good for now. Go ahead and lock the thread.

Re: MYSQL Database Issue with Bulk Modifications Tool

Posted: Fri Feb 03, 2017 10:14 am
by rkennedy
Done - feel free to make a new thread if you'd like an update on it.