PortDescr depends on the interface description on the switches: in case of an empty description the field will report something very similar to the PortID, but in case the port description on the switch has been filled in, then this will be reported on Proxmox's interface file thus potentially masking the true ID of the interface.
This was tested with the following equipment:
- Huawei Quidway and Cloud Managed switches
- Cisco Catalyst 9300X
- HPE OfficeConnect switches
Something like the following should work:
@@ -64,10 +64,10 @@
while IFS= read -r line; do
if [[ "$line" =~ Interface: ]]; then
iface=$(echo "$line" | awk '{print $2}' | tr -d ',')
- elif [[ "$line" =~ PortDescr: ]]; then
- port_descr=$(echo "$line" | cut -d ' ' -f 2-)
- log "Processing $iface with port description $port_descr."
- update_description "$iface" "$port_descr"
+ elif [[ "$line" =~ PortID: ]]; then
+ port_id=$(echo "$line" | cut -d ' ' -f 2-)
+ log "Processing $iface with port description $port_id."
+ update_description "$iface" "$port_id"
fi
done < <(lldpcli show neighbors)
PortDescr depends on the interface description on the switches: in case of an empty description the field will report something very similar to the PortID, but in case the port description on the switch has been filled in, then this will be reported on Proxmox's interface file thus potentially masking the true ID of the interface.
This was tested with the following equipment:
Something like the following should work: