glpi-project / glpi-agent

GLPI Agent
GNU General Public License v2.0
243 stars 61 forks source link

Docker containers not reported in GLPI #787

Open fabriceverkor opened 1 week ago

fabriceverkor commented 1 week ago

Bug reporting acknowledgment

Yes, I read it

Professional support

Yes, I know

Describe the bug

A customer noticed that some computers had their Virtual Machine tab filled by their hosted Docker containers, some other no. We never had a look on this part and we don't know if it is a regression.

To reproduce

  1. launch glpi-agent on computer hosting Docker containers
  2. check that local XML generated file contains a section listing docker containers
  3. In GLPI, the last inventory date of computer is the same than the local file above.
  4. Nothing is reported in Virtual Machine tab of computer
  5. The downloadable JSON file from GLPI interface does contain any virtual machine section

I'm confused.

Expected behavior

Docker containers should be reported in "Virtual Machine" tab of the computer.

Operating system

Linux

GLPI Agent version

v1.10

GLPI version

10.0.x (See additional context below)

GLPIInventory plugin or other plugin version

GLPI Inventory v1.3.4

Additional context

No response

g-bougard commented 1 week ago

Hi @fabriceverkor

  1. The downloadable JSON file from GLPI interface does contain any virtual machine section

Does or doesn't ? Without any inventory sample I can doubt you forgot a negation here.

If the stored json is a partial inventory (check for a "partial": true in the json), virtualmachines won't be provided if they didn't change since the last VM inventory change or last full inventory. You should better check the result of the following command run as root on the computer itself:

glpi-inventory --partial=virtualmachine
fabriceverkor commented 1 week ago

Sorry : The downloadable JSON file from GLPI interface does NOT contain any virtual machine section But glpi-inventory --partial=virtualmachine works fine with a virtualmachines JSON list.

I tested again with glpi-agent --debug The new local xml file contains containers info, just like the ones reported by glpi-inventory command.

But it is not updated on GLPI side. And new GLPI JSON file does NOT contain the virtualmachines JSON list above. But indeed, many sections are missing in GLPI JSON file (controllers, cpus, firewalls, inputs, ..)

Does it mean that GLPI JSON file is just a filtered version of JSON generated by local agent ? Is it a compliance problem (agent or glpi or glpi inventry plugin versions) ? Thx

g-bougard commented 1 week ago

When I'm speaking about partial inventory, this is about this glpi-agent feature: https://github.com/glpi-project/glpi-agent/discussions/592

And as I said:

virtualmachines won't be provided if they didn't change since the last VM inventory change or last full inventory.

This is normal and should not be related to your issue as GLPI is not intended to delete from the asset any category not set in a partial inventory.

The real question is: Is any docker container missing from the partial inventory generated by the command I gave you ?

If not, you can manually import it and check if all container are imported. If not, the problem is not glpi-agent.

fabriceverkor commented 22 hours ago

I see. By using full option,the stored JSON contains now virtualmachines. But Virtualization tab is still empty. Should I do something else ?