Page 1 of 1

[SOLVED] glpi-plugin-export-to-glpi10

Published: Dec 13, 2024 - 10:11
by TomTom
Hello everyone,

Since updating our server to version 2.6, the data transfer to GLPI is no longer working correctly.
Oddly, only 36 machines out of our 240 are transferring correctly. The vast majority are servers running Debian/Ubuntu.

Can anyone help me with this?

Thanks in advance
, Thomas

Re: glpi-plugin-export-to-glpi10

Published: Dec 17, 2024 - 11:24
by blemoigne
Hi Thomas,
You can install the audit-glpi-inventory package on all machines to get the official GLPI inventory and then try exporting it again.
Have a good day,
Bertrand

Re: glpi-plugin-export-to-glpi10

Published: Dec 17, 2024 - 1:57 PM
by TomTom
Hi Bertrand,

Has the way things work changed with version 2.6? I'd like to avoid deploying an agent on my machines.
Letting the server handle it seemed like a good idea, though.

Re: glpi-plugin-export-to-glpi10

Published: Dec 17, 2024 - 5:09 PM
by sfonteneau
On the machines in WAPT that aren't reporting correctly, do you have any information in the audit data tab?

Are you using the latest version of the GLPI audit export package?

Re: glpi-plugin-export-to-glpi10

Published: Dec 18, 2024 - 08:17
by TomTom
Hello Simon,

Yes, I am indeed using the latest version. However, I do have audit data, but there are errors on some workstations that are not being reported

Code: Select all

{"status":"error","message":"JSON does not validate. Violations:\nString expected, 2022 received at #->properties:content->properties:monitors->items[0]:0->properties:description\n","expiration":24}
2024-12-18_08h30_08.png
2024-12-18_08h30_08.png (53.51 KB) Viewed 6278 times

Re: glpi-plugin-export-to-glpi10

Published: Dec 18, 2024 - 1:29 PM
by sfonteneau
From what I understand, it's not working because this part of the export package code isn't functioning:

Code: Select all

        # MONITOR
        for monitor in self.data["host_info"].get("monitors", {}):
            newmonitor = {
                "base64": monitor.get("b64_edid", ""),
                "caption": monitor.get("name", "") if monitor.get("name", "") else "Not Found",
                "description": monitor.get("manufactured", ""),
                "manufacturer": monitor.get("manufacturer", ""),
                "port": monitor.get("port", ""),
                "serial": str(monitor.get("serialno", "")),
            }
            jsondata["content"]["monitors"].append(delete_empty_entry_in_dict(newmonitor))
And from what I understand, it's the value of "manufactured" that's the problem.

in the inventory of equipment:
host_info->monitors->[*]->manufactured

It must be formatted incorrectly...

As Bertrand indicated above

You can install this package on the machine:

https://wapt.tranquil.it/store/fr/tis-a ... -inventory

It allows you to retrieve the GLPI inventory in the machine audit data tab.

This allows sending the exact same inventory from GLPI to GLPI (in this case, the GLPI inventory is not rebuilt from the Wapt inventory; it actually uses the GLPI inventory, so Wapt acts as a gateway)

When the glpi-plugin-export-to-glpi10 package runs, if it sees that an audit record "audit-glpi-inventory" is available, then it directly uses that record

Re: glpi-plugin-export-to-glpi10

Published: Dec 18, 2024 - 2:34 PM
by TomTom
Thanks Simon for the explanations, I'm starting to understand the workings of this GLPI audit package a bit better.

Indeed, after deploying it, my machines are once again uploading their inventory to GLPI. Great!

Another question: why does the audit-glpi package for Linux have a dependency? Can it be deployed without it?

Re: glpi-plugin-export-to-glpi10

Published: Dec 18, 2024 - 3:30 PM
by sfonteneau
TomTom wrote: Dec 18, 2024 - 2:34 PM Another question: does the audit-glpi package for Linux have a dependency? Can it be depolymerized without it?
Indeed, the tis-audit-glpi-inventory package has a dependency on tis-glpi-agent because it really needs the GLPI agent to build the inventory

The GLPI agent is only used to generate the inventory; it is not connected to a server

Re: glpi-plugin-export-to-glpi10

Published: Dec 18, 2024 - 4:56 PM
by TomTom
The inventory of Linux machines is now up to date.

Thank you very much, Simon and Bertrand. I'm closing this!