You are not logged in.
Pages: 1
Hi,
We are experiencing a problem with the latest version of GLPI ( 10.0.3 ).
I have created a "Location Rule" that assigns a location to a computer based on its IP Address.
When a new computer matches its criteria, instead of assign the location specified, GLPI creates a new location, naming it as the database id of the correct location and assign it to the computer, instead of using the existing one.
For example;
If I check the table glpi_location I have:
id name
-- -----------
7 Barcelona
When I import a computer that matches the criteria, a new row is created on the table glpi_location:
id name
-- -----------
7 Barcelona
8 7
And the new computer is assigned to the new location named "7", instead of the expected "Barcelona".
I tried to delete all locations and start over again, but the behaviour persists.
How can i make it work properly?
Thanks!
Offline
anyone?
Offline
I also have the same issue, exactly the same.
Anyone help ?
thanks for your help
Offline
I don't know how to solve it, but I have found a workaround.
I have created a Stored Procedure in MariaDB that updates the location_id at glpi_computers and glpi_monitors tables:
DELIMITER $$
CREATE DEFINER=`username`@`localhost` PROCEDURE `correct_locations`( IN bad_loc INT, IN right_loc INT)
BEGIN
UPDATE `glpi_computers`
set
`locations_id` = right_loc where `locations_id` = bad_loc;
UPDATE `glpi_monitors`
set
`locations_id` = right_loc where `locations_id` = bad_loc;
END$$
DELIMITER ;
Then, I have set an event that is launched every minute passing as parameteres the location_id that must be corrected. For example:
DELIMITER $$
ALTER DEFINER=`username`@`localhost` EVENT `keep_locations` ON SCHEDULE EVERY 1 MINUTE STARTS '2022-10-05 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
CALL correct_locations(9,7);
CALL correct_locations(25,13);
CALL correct_locations(26,12);
CALL correct_locations(27,10);
CALL correct_locations(28,18);
CALL correct_locations(29,22);
END$$
DELIMITER ;
Hope it helps.
Offline
I have reported as an issue on github
Offline
Pages: 1