MYSQL Database Issue with Bulk Modifications Tool

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
pnnagios
Posts: 47
Joined: Wed Dec 14, 2011 9:48 am

MYSQL Database Issue with Bulk Modifications Tool

Post 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
You do not have the required permissions to view the files attached to this post.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: MYSQL Database Issue with Bulk Modifications Tool

Post 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
Former Nagios Employee
pnnagios
Posts: 47
Joined: Wed Dec 14, 2011 9:48 am

Re: MYSQL Database Issue with Bulk Modifications Tool

Post by pnnagios »

Sounds good. Hopefully, this will be fixed in a future release.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: MYSQL Database Issue with Bulk Modifications Tool

Post 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?
pnnagios
Posts: 47
Joined: Wed Dec 14, 2011 9:48 am

Re: MYSQL Database Issue with Bulk Modifications Tool

Post by pnnagios »

All good for now. Go ahead and lock the thread.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: MYSQL Database Issue with Bulk Modifications Tool

Post by rkennedy »

Done - feel free to make a new thread if you'd like an update on it.
Former Nagios Employee
Locked