glpi-project / glpi-agent

GLPI Agent
GNU General Public License v2.0
212 stars 51 forks source link

SNMP NetInventory returns wrong ports and doesn't report all connected devices #603

Closed OnSlbWXt closed 3 weeks ago

OnSlbWXt commented 4 months ago

Bug reporting acknowledgment

Yes, I read it

Professional support

Yes, I know

Describe the bug

NetInventory Task returns wrong port numbers for connections and doesn't list all connections with Unifi-Switches.

Issues this causes:

netinventory Only shows 2 of the 4 connected devices, and all on port 3, while nothing is actually connected on port. See below.

To reproduce

  1. glpi-netinventory --community [...] --host [...] snmp-walk.walk.txt
  2. see wrong output inventory.xml.txt

Expected behavior

For all connections to be displayed and on the correct ports. Here is a somewhat fixed xml, where I manually entered the connected MAC addresses where they belong. (Port 9 being the upstream port) inventory_fixed.xml.txt The correct port information can be found under SNMP node 1.3.6.1.2.1.17.4.3.1 or 1.3.6.1.2.1.17.7.1.2.2.1 image

Operating system

Linux

GLPI Agent version

1.7, Nightly build (git version in additional context below)

GLPI version

10.0.12, Not applicable

GLPIInventory plugin or FusionInventory for GLPI plugin version

GLPI Inventory v1.3.4, Not applicable

Additional context

GLPI agent: ea453479a6f31815151c8da75e07f724168afccf and 1.7.1-1 are affected

The snmp walks are slightly edited. serialnumber has been zeroed and MACs have been anonymized by zeroing the first 5 blocks.

g-bougard commented 3 weeks ago

Hi @OnSlbWXt

sorry to take care of your issue so lately, I had a lot of work on windows packaging.

I can't actually go forward as it seems your walk is missing some important datas related to connection support. Can you provide the walk generated using the option from the snmpwalk command you'll find there: https://glpi-agent.readthedocs.io/en/latest/bug-reporting.html#snmpwalk-output Then you can send it to me by email to avoid leaking any confidential datas. My email: gbougard <at> teclib <dot> com

Also if not still done, can you test with latest glpi-agent 1.9 version. Some work has been done on ubiquiti support, but this doesn't concern connections detection.

OnSlbWXt commented 3 weeks ago

I have good news and bad news: good news: the issue appears to be resolved with agent version 1.9 bad news: I have no idea why and can't reproduce the issue anymore (I suspect firmware updates)

g-bougard commented 3 weeks ago

Thank you for the update.

Firmware update can sometime resolve such kind of problem.