Remove Free Variables Bulk Modifications Tool

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
wneville
Posts: 56
Joined: Wed Mar 31, 2021 3:35 pm

Remove Free Variables Bulk Modifications Tool

Post 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
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Remove Free Variables Bulk Modifications Tool

Post 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.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Remove Free Variables Bulk Modifications Tool

Post 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
wneville
Posts: 56
Joined: Wed Mar 31, 2021 3:35 pm

Re: Remove Free Variables Bulk Modifications Tool

Post by wneville »

Worked great. Thank you!
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Remove Free Variables Bulk Modifications Tool

Post 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!
Locked