fusioninventory-agent icon indicating copy to clipboard operation
fusioninventory-agent copied to clipboard

How to skip importing type=docker from virtual machines

Open raulk89 opened this issue 2 years ago • 9 comments

Hi

fusioninventory-agent-2.6-1.el7.x86_64 CentOS Linux 7

My question is, how we can skip importing dockers to glpi inventory ..? At the moment if we have N amount dockers running from virtual machine, then it will discovery each docker as a new entity. We do not want that.

Is there a possibility to disable discovering those..?

Regards Raul

raulk89 avatar Jan 13 '23 06:01 raulk89

Temporary hack, that will work:

Modifying first row of file:
/usr/share/fusioninventory/lib/FusionInventory/Agent/Task/Inventory/Virtualization/Docker.pm

package FusionInventory::Agent::Task::Inventory::Virtualization::Docker;
-->
#package FusionInventory::Agent::Task::Inventory::Virtualization::Docker;

But that will be overwritten by future releases. So looking for a more permanent solution.

Raul

raulk89 avatar Jan 13 '23 07:01 raulk89

If you don't have any other virtualization type on this computer, the best way should be to use: no-category = virtualmachine If you have other types of virtualization, just remove the file you modified. If you don't see new fi-agent release, you should probably take a look at glpi-agent which is a fork of fusioninventory-agent with a lot of fixes and new features.

g-bougard avatar Jan 13 '23 08:01 g-bougard

This parameter also works yes. Thanks.

Is this a feature, that glpi software (GLPI 10.0.5) loses all the dependencies for the VM where certain docker container resides..?

At the moment, from glpi UI, there is no link from the docker container to the VM it resides. Each container is separate entity. When I deleted VM (and emptied trash bin), all the containers remained intact.

Seems odd, that there is no link to the VM.

Raul

raulk89 avatar Jan 13 '23 08:01 raulk89

it's a simple link, so yes if you delete the computer, the VMs are not deleted

ddurieux avatar Jan 13 '23 08:01 ddurieux

No I mean, type=docker is running on certain VM. There seems no link between those. When I delete VM, the dependent docker items should also be deleted.

Raul

raulk89 avatar Jan 13 '23 09:01 raulk89

It depends where you're running the agent. Do you run it into docker ? and the VM ? The link can only be created if you run it into the two ends.

g-bougard avatar Jan 13 '23 09:01 g-bougard

We run it only on VM.

Raul

raulk89 avatar Jan 13 '23 09:01 raulk89

You're using GLPI 10.0.5 ? Do you use native inventory or FusionInventory for GLPI Plugin ? If you're using GLPI 10, what did you configure in inventory Administration regarding "Virtualization": image

g-bougard avatar Jan 13 '23 09:01 g-bougard

We use "FusionInventory" at the moment. We did this change from both.

FusionInventory: image

Native Inventory: image

No luck. Still those type=docker entities were created.

Raul

raulk89 avatar Jan 13 '23 10:01 raulk89