fusioninventory / fusioninventory-for-glpi

FusionInventory plugin for GLPI
http://www.FusionInventory.org/
GNU Affero General Public License v3.0
361 stars 148 forks source link

FI: network inventory- unmanaged devices are only in the Root entity #2485

Open joschi99 opened 6 years ago

joschi99 commented 6 years ago

Environment:

We have configured some entity under root. On certain entities we have configured jobs for network discovery and network inventory. the networks are also configured in this entities. The printers, network devices ecc. are discovered and inventoried correctly and they are automatically in the same entity where we defined the network and the jobs. But all devices not correctly inventoried by the job are under the root entity under unmanaged devices. How it is possible to have this unmanaged devices automatically in the correct entity?

Regards, Jochen

joschi99 commented 6 years ago

We discovered that there was a bug on FIA (https://github.com/fusioninventory/fusioninventory-agent/issues/506), fusioninventory-netdiscovery did not returned the ENTITY on the XML output. We implemented the fix for this, but we have still the same behavior.

So I think we have 2 possibilities about this issue: 1) the FI server don't send the entity to the FIA in the correct way and the FIA starts the netdiscovery job without the entity option 2) FI server are not considering in the correct way the entity information send back from FIA

For the first point unfortunately the debug mode on FIA are not sending a output about the start parameters, so we cannot see if FI send's the parameter to FIA.

I hope that this information's could help. For any question or further investigation please let me know.

Regards, Jochen

joschi99 commented 6 years ago

I discovered that the problem is not the netdiscovery task but the problem is related to the netinventory taks. When the netinventory scan's a switch, he reads which device is connected on which port. If he found a unknow asset, he import this asset to "unmanaged devices" alway on the root entity and create a link to the port from the switch, which is on the right entity (not root).

I tried to find a rule where i can change this behavior, but i can't find it. Is this only a configuration problem or a bug?

g-bougard commented 6 years ago

Hi @joschi99 can FusionInventory Agent 2.4.1 help as now it includes the fix you requested ? Or do you mean server-side is missing something ?

joschi99 commented 6 years ago

Hi @g-bougard, the fix on FIA 2.4.1 does not resolve the problem, there must be a problem on server-side. And it seem's more related know on netinventory and not netdiscovery. The unmanaged devices on "root entity" seem's coming from netdiscovery, when he try to link assets with the ports. I can reproduce the problem, but not sure for 100% where is the bug.

joschi99 commented 6 years ago

The netdiscovery job makes the inventory of the switch and on server side it seem's that every MAC Address from the switch connections that are not known are automatically open as "unmanaged device" on root entity. I have some example from the XML output

        <PORT>
          <CONNECTIONS>
            <CDP>1</CDP>
            <CONNECTION>
              <IFNUMBER>f0 92 1c da 2b b9</IFNUMBER>
              <SYSDESCR>Emulex OneConnect 10Gb Multi function Adapter</SYSDESCR>
              <SYSMAC>f0:92:1c:da:2b:b9</SYSMAC>
            </CONNECTION>
          </CONNECTIONS>
          <IFDESCR>TenGigabitEthernet 0/24</IFDESCR>
          <IFINERRORS>0</IFINERRORS>
          <IFINOCTETS>3858824387</IFINOCTETS>
          <IFINTERNALSTATUS>1</IFINTERNALSTATUS>
          <IFLASTCHANGE>225 days, 10:57:09.06</IFLASTCHANGE>
          <IFMTU>12000</IFMTU>
          <IFNAME>TenGigabitEthernet 0/24</IFNAME>
          <IFNUMBER>23397378</IFNUMBER>
          <IFOUTERRORS>0</IFOUTERRORS>
          <IFOUTOCTETS>2174634777</IFOUTOCTETS>
          <IFPORTDUPLEX>3</IFPORTDUPLEX>
          <IFSPEED>10000000000</IFSPEED>
          <IFSTATUS>1</IFSTATUS>
          <IFTYPE>6</IFTYPE>
          <MAC>00:01:e8:d8:7c:8a</MAC>
          <TRUNK>0</TRUNK>
          <VLANS>
            <VLAN>
              <NAME>storage</NAME>
              <NUMBER>20</NUMBER>
            </VLAN>
          </VLANS>
        </PORT>

In this case we habe a unmanaged device with MAC Address f0 92 1c da 2b b9 on root entity which is connected to the inventoried switch on a sub entity. image

joschi99 commented 6 years ago

Hi @g-bougard, did you habe any news about this issue? It would be great if we can find a solution for this problem.

Regards

g-bougard commented 6 years ago

Hi @joschi99

now you should wait the @ddurieux answer.

ddurieux commented 6 years ago

It's in unmanaged because it not find the device with the ifnumber (the CDP part in the XML)

g-bougard commented 6 years ago

Yes, but why it is set in root entity, and then does it matter ?

danicouso commented 3 years ago

Hello everyone. A solution been found to this?

I have a switch, the switch is in an entity, there are 3 unmanaged device on the switch interface, the unmanaged devices are in the root entity when imported by fusion inventory.

So I edit the unmanaged devices and transfer them to the same entity as the switch. When launching the fusion inventory agent a new unmanaged device is created in the root entity linked to the switch ignoring the previous linked device which I edited to the correct entity.

In every update of the inventory fusion agent a new unmanaged device is always created linked to the switch interface. This keep off classifying the devices in their corresponding entity.

Thank you all very much, greetings