glpi-project / glpi-agent

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

Aggregated switch ports are not inventoried (by default in GLPI) #683

Closed blackbasket closed 6 months ago

blackbasket commented 6 months ago

Bug reporting acknowledgment

Yes, I read it

Professional support

None

Describe the bug

The inventory of aggregated switch Ports (trunked as well as LACP protocol) is not working. I am using agent 1.8 on Windows to query the switches using SNMP v2c. The hardware ports are inventoried and listed, but the aggregated ports are missing. All switches are HP.

Imported ports of one switch: Screenshot 2024-05-28 114032

Missing aggregated ports from config: Screenshot 2024-05-28 114124

To reproduce

I tried mulitple discoveries and inventories

Expected behavior

When the inventory of a switch is made, all the ports should be inventoried

Operating system

Windows

GLPI Agent version

1.8

GLPI version

10.0.14

GLPIInventory plugin or other plugin version

GLPI Inventory v1.3.5

Additional context

No response

g-bougard commented 6 months ago

Hi @blackbasket

please, can you provide 2 things for one of your concerned HP switches:

  1. a snmpwalk output using the command from a linux platform as explained here: https://glpi-agent.readthedocs.io/en/latest/bug-reporting.html#snmpwalk-output
  2. a XML generated by NetInventory task showing something is missing: you can extract it from glpi-agent log when debug=2 is enabled in glpi-agent configuration
blackbasket commented 6 months ago

Hi @g-bougard

Thanks for your reply... please find the requested files attached... (in PRTG Network Monitor the aggregated Port trk2 is shown with index 50... from that I know that normally also local loopback ports etc were imported initially... this ones are missing as well...

snmpwalk.txt sw030_xml.txt

btw: I realized that for the FortiGate firewall not even the ports were inventoried... all IPs are attached to just one port... should I create a seperate issue for this?

edit: corrected trk1 to trk2 as index 50

g-bougard commented 6 months ago

Hi @blackbasket

fortunately, your walk seems to be truncated: it finishes with Timeout: No Response from 172.31.255.30. And I can't use it so.

Anyway when looking at the XML, I can see Trk2 with IFNUMBER=50:

        <PORT>
          <AGGREGATE>
            <PORT>13</PORT>
            <PORT>14</PORT>
          </AGGREGATE>
          <IFDESCR>Trk2</IFDESCR>
          <IFINERRORS>11491</IFINERRORS>
          <IFINOCTETS>3470389977</IFINOCTETS>
          <IFINTERNALSTATUS>1</IFINTERNALSTATUS>
          <IFLASTCHANGE>231 days, 13:32:14.60</IFLASTCHANGE>
          <IFMTU>1500</IFMTU>
          <IFNAME>Trk2</IFNAME>
          <IFNUMBER>50</IFNUMBER>
          <IFOUTERRORS>0</IFOUTERRORS>
          <IFOUTOCTETS>2228991958</IFOUTOCTETS>
          <IFSPEED>20000000</IFSPEED>
          <IFSTATUS>1</IFSTATUS>
          <IFTYPE>161</IFTYPE>
          <MAC>b4:39:d6:8b:5c:00</MAC>
          <VLANS>
            <VLAN>
              <NAME>Server</NAME>
              <NUMBER>150</NUMBER>
              <TAGGED>0</TAGGED>
            </VLAN>
            <VLAN>
              <NAME>Lebensnah</NAME>
              <NUMBER>160</NUMBER>
              <TAGGED>1</TAGGED>
            </VLAN>
            <VLAN>
              <NAME>DMZ</NAME>
              <NUMBER>333</NUMBER>
              <TAGGED>1</TAGGED>
            </VLAN>
            <VLAN>
              <NAME>Videoueberwa</NAME>
              <NUMBER>777</NUMBER>
              <TAGGED>1</TAGGED>
            </VLAN>
          </VLANS>
        </PORT>

I see aggregate datas. So to me aggregate is inventoried from the glpi-agent point of view.

But you can notice IFTYPE is set to 161. I know this IFTYPE is not imported by default in GLPI.

By default, this port type is not integrated in GLPI. In GLPI, check in "Setup", "Dropdowns" and list "Network port types" from "Networking" section. Here you can edit "ieee8023adLag" for which decimal number is 161. You can change "Import" from "No" to "Yes" and choose "Instanciation type" and maybe set it to "Aggregation port".

So try to setup ieee8023adLag port type as I explained and tell us if this fixes your issue.

blackbasket commented 6 months ago

Hi @g-bougard

Thank you... changing the port type settings fixed it...

Regards, Marcel

blackbasket commented 6 months ago

Hi @g-bougard

I reopen this... I set it up as you told me above including the type "Aggregation port"... I now realized that it is added as "NetworkPortEthernet" anyway and therefore I cannot select the trunked ports...

Do you have any idea?

g-bougard commented 6 months ago

Hi @blackbasket

sorry, this is definitively a problem to be discussed on GLPI project as everything seems correct on agent-side.

So open a glpi issue and link there this issue.

GuidoWilden commented 6 months ago

Thank you for the explanation @g-bougard but for us still nothing shows. Do I understand this correct? When checking in Setup > Dropdowns > Networking > Network port types there is nothing there. I have then added an entry for ieee8023adLag and set the parameters as per above but still nothing gets inventoried for us. Not sure what I am missing.

GuidoWilden commented 6 months ago

Sorry I think I figured it out. This one has to be done via the GLPI inventory plugin. Please ignore.

GuidoWilden commented 6 months ago

OK it seems I have this working now, however the outcome is hit and miss and very different on Linux and Windows. So would be good to get this addressed on the server side. If there is any information I can share please let me know.