Page 1 of 2

Wapt 2.2 and GLPI 10

Published: April 21, 2022 - 2:25 PM
by t.heroult
Hello,

With the arrival of GLPI 10, the FusionInventory plugin has disappeared and been replaced by the GLPI agent.
As a result, the "target" http://glpitest/glpi/plugins/fusioninventory is no longer usable.

The GLPI agent uses the URL http://glpitest/glpi/front/inventory.php.

I tried this address in the WAPT configuration, but it doesn't return anything...

I haven't found anything in the WAPT 2.2 documentation regarding GLPI 10.

Has anyone found a solution?

Best regards,
Tom.

Edit: Apparently, we should also be able to use the new GLPIInventory plugin, which is a fork of FusionInventory, which in my case gives: http://glpitest/glpi/plugins/glpiinventory/ but again, nothing.

Re: Wapt 2.2 and GLPI 10

Published: April 22, 2022 - 10:59 AM
by t.heroult
Additional information:
Extract from wapttask.log if the target is: http://glpitest/glpi/plugins/glpiinventory/

Code: Select all

Apr 22 10:49:25 SRVWAPTTEST wapttasks[407]: [2022-04-22 10:49:25,539] INFO:huey:Worker-2:Executing waptserver.glpi_tasks.upload_to_glpi_cron: b07c742b-ee1d-4253-9476-3d4b2e3f6967
Apr 22 10:49:25 SRVWAPTTEST wapttasks[407]: [2022-04-22 10:49:25,540] [Glpi Inventory]: DEBUG : Updating from databases...
Apr 22 10:49:25 SRVWAPTTEST wapttasks[407]: [2022-04-22 10:49:25,679] [Glpi Inventory]: INFO : -------Uploading 8 inventories to Glpi-------
Apr 22 10:49:25 SRVWAPTTEST wapttasks[407]: [2022-04-22 10:49:25,692] [Glpi Inventory]: DEBUG : Uploading (1/8)  [TestMachine1]
Apr 22 10:49:25 SRVWAPTTEST wapttasks[407]: [2022-04-22 10:49:25,821] ERROR:huey:Worker-2:Unhandled exception in task b07c742b-ee1d-4253-9476-3d4b2e3f6967.
Apr 22 10:49:25 SRVWAPTTEST wapttasks[407]: Traceback (most recent call last):
Apr 22 10:49:25 SRVWAPTTEST wapttasks[407]:   File "/opt/wapt/lib/python3.8/site-packages/huey/api.py", line 360, in _execute
Apr 22 10:49:25 SRVWAPTTEST wapttasks[407]:     task_value = task.execute()
Apr 22 10:49:25 SRVWAPTTEST wapttasks[407]:   File "/opt/wapt/lib/python3.8/site-packages/huey/api.py", line 724, in execute
Apr 22 10:49:25 SRVWAPTTEST wapttasks[407]:     return func(*args, **kwargs)
Apr 22 10:49:25 SRVWAPTTEST wapttasks[407]:   File "/opt/wapt/lib/python3.8/site-packages/huey/api.py", line 807, in inner
Apr 22 10:49:25 SRVWAPTTEST wapttasks[407]:     return fn(*args, **kwargs)
Apr 22 10:49:25 SRVWAPTTEST wapttasks[407]:   File "/opt/wapt/waptserver/glpi_tasks.py", line 34, in upload_to_glpi_cron
Apr 22 10:49:25 SRVWAPTTEST wapttasks[407]:     upload_hosts_inventories(conf['glpi_server_user'], conf['glpi_server_pass'], conf['glpi_server_endpoint'],
Apr 22 10:49:25 SRVWAPTTEST wapttasks[407]:   File "/opt/wapt/waptserver/glpi_upload_hosts.py", line 198, in upload_hosts_inventories
Apr 22 10:49:25 SRVWAPTTEST wapttasks[407]:     res_tree = xml.etree.ElementTree.fromstring(r.content)
Apr 22 10:49:25 SRVWAPTTEST wapttasks[407]:   File "/opt/wapt/lib/python3.8/xml/etree/ElementTree.py", line 1320, in XML
Apr 22 10:49:25 SRVWAPTTEST wapttasks[407]:     parser.feed(text)
Apr 22 10:49:25 SRVWAPTTEST wapttasks[407]: xml.etree.ElementTree.ParseError: undefined entity: line 3, column 223
If we try to put: http://glpitest/glpi/front/inventory.phpUpon validation, it is immediately replaced by http://glpitest/glpi/front/inventory.php/ (so it automatically adds a "/" at the end, which can obviously cause problems, the target being a file and not a folder.

Re: Wapt 2.2 and GLPI 10

Published: April 22, 2022 - 12:37 PM
by dcardon
Hello Tom,

You summarized the situation well in your post:
  • The native GLPI 10 import format is not compatible with the Fusion format. Therefore, currently, WAPT -> GLPI synchronization does not work with this new native module
  • The Fusion Inventory module should be able to be loaded on a GLPI 10 server, and it should work identically.
Compared to the new GLPI JSON import format, this one is much better documented and far less convoluted, so it's a step in the right direction. We'll look into refactoring the WAPT code at this point and using the GLPI10/JSON export in addition to the Fusion/XML format.

I set up a GLPI 10 server this week to look into this, but I haven't tested the Fusion plugin. We'll check if it still works the same way (that's what it says in the documentation) :-) )
Sincerely,

Denis

Re: Wapt 2.2 and GLPI 10

Published: April 22, 2022 - 1:14 PM
by t.heroult
The fact is that the FusionInventory plugin simply no longer exists in GLPI 10.
It's automatically disabled and can only be uninstalled.
We should be able to use the glpiinventory plugin, which is a (highly questionable) fork of FI by teclib.
In theory, then, we can install this plugin and it will behave "exactly" like FusionInventory.

But, well, there's theory and then...

Interesting information in the large orange box: https://glpi-agent.readthedocs.io/en/la ... ation.html

Re: Wapt 2.2 and GLPI 10

Published: May 19, 2022 - 09:04
by t.heroult
Hi Denis,

Just checking in. There have been two Wapt updates since this thread started, and there's still nothing new regarding GLPI.
Do you have any ideas?
If I can help...

Best regards,
Tom

Re: Wapt 2.2 and GLPI 10

Published: May 19, 2022 - 09:52
by sfonteneau
Hello,

I've created the XML to JSON inventory conversion function and it works.
Now I need to integrate it with Wapt.

The current GLPI inventory sending system is really not ideal; we're going to revise it to make it more modular as a plugin. This will allow exporting to systems other than GLPI, such as CyberWatch, and will also make it easier to create patches without needing to update Wapt itself.

Simon

Re: Wapt 2.2 and GLPI 10

Published: May 20, 2022 - 11:08 AM
by t.heroult
Thanks Simon for the good news!

Can't wait to see it, :)

Tom

Re: Wapt 2.2 and GLPI 10

Published: July 5, 2022 - 3:24 PM
by infocfd
Hello,
Any updates on the issue of data migration to GLPI 10 from Wapt 2.2?

Thanks,

Denis

Re: Wapt 2.2 and GLPI 10

Published: July 5, 2022 - 10:41 PM
by sfonteneau
The plugins have been implemented in the new version of WAPT (via the auditing system).

We should hopefully offer this at the same time as the new version of WAPT.

A migration will be necessary because, in terms of functionality, it differs between WAPT and GLPI.

Re: Wapt 2.2 and GLPI 10

Published: July 6, 2022 - 11:19 AM
by t.heroult
OK, thanks for the feedback :)

! Looking forward to it!