Page 1 of 1

Remove Free Variables Bulk Modifications Tool

Posted: Mon Oct 18, 2021 10:38 am
by wneville
Hello,

I have about 300 hosts from which I want to remove a free variable. When I navigate to the BUlk Modifications Tool and click "remove free variables" --> select my free variable and click "find relationships" nothing happens. I waited about 4 minutes after clicking the button and nothing happened. Strange because the "add free variables" within Bulk Mods Tool works just fine. Is this something you all have seen before?

Thanks

Re: Remove Free Variables Bulk Modifications Tool

Posted: Mon Oct 18, 2021 5:06 pm
by ssax
Please edit this file:

Code: Select all

/usr/local/nagiosxi/html/includes/components/bulkmodifications/ajaxreqs.php
Change this from (line 480):

Code: Select all

$query = "SELECT `tbl_host`.`id` as id, `host_name`,`tbl_variabledefinition`.`value` FROM `tbl_lnkHostToVariabledefinition` LEFT JOIN `tbl_host` ON `idMaster` = `tbl_host`.`id` JOIN `tbl_variabledefinition` ON `idSlave` = `tbl_variabledefinition`.`id` WHERE `idSlave` IN ({$ids})";
To:

Code: Select all

$query = "SELECT `tbl_host`.`id` as id, `host_name`,`tbl_variabledefinition`.`value` FROM `tbl_lnkHostToVariabledefinition` LEFT JOIN `tbl_host` ON `idMaster` = `tbl_host`.`id` JOIN `tbl_variabledefinition` ON `idSlave` = `tbl_variabledefinition`.`id` WHERE `idSlave` IN ({$id})";
Then try it again.

Remove Free Variables Bulk Modifications Tool

Posted: Mon Oct 18, 2021 5:11 pm
by ssax
Please edit this file:

Code: Select all

/usr/local/nagiosxi/html/includes/components/bulkmodifications/ajaxreqs.php
Change this from (line 480):

Code: Select all

$query = "SELECT `tbl_host`.`id` as id, `host_name`,`tbl_variabledefinition`.`value` FROM `tbl_lnkHostToVariabledefinition` LEFT JOIN `tbl_host` ON `idMaster` = `tbl_host`.`id` JOIN `tbl_variabledefinition` ON `idSlave` = `tbl_variabledefinition`.`id` WHERE `idSlave` IN ({$ids})";
To:

Code: Select all

$query = "SELECT `tbl_host`.`id` as id, `host_name`,`tbl_variabledefinition`.`value` FROM `tbl_lnkHostToVariabledefinition` LEFT JOIN `tbl_host` ON `idMaster` = `tbl_host`.`id` JOIN `tbl_variabledefinition` ON `idSlave` = `tbl_variabledefinition`.`id` WHERE `idSlave` IN ({$id})";
Then try it again.

EDIT: I have submitted a bug report for this so development can fix it:

Code: Select all

NEW TASK ID 15653 created - Nagios XI Bug Report: XI - Bulk Mods Remove Free Variables bug

Re: Remove Free Variables Bulk Modifications Tool

Posted: Tue Oct 19, 2021 3:05 pm
by wneville
Worked great. Thank you!

Re: Remove Free Variables Bulk Modifications Tool

Posted: Wed Oct 20, 2021 9:38 am
by ssax
That's great to hear! Let us know when we're okay to lock this up and mark it as resolved.

Thank you!