Trying to get FDB Tables to work on ArubaOS 7

Hi,

I wanted to post this at https://github.com/librenms/librenms/issues but it looks like that is only for committing new features and not questions.

I’m trying to get FDB Tables to work on ArubaOS and ran into some issues. Earlier I was able to run poller.php -h sw-name -vv && discovery.php -h sw-name -vv -dd
and it added the MAC addresses but no port number was shown in FDB Tables (in the database, port_id were all 0). I went into the database and deleted the rows in ports_fdb and now when I run discovery again, I get an error while it’s trying to insert NULL for port_id.

<VLAN>: #0 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php(624): Illuminate\Database\Connection->runQueryCallback('insert into `po...', Array, Object(Closure))
#1 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php(459): Illuminate\Database\Connection->run('insert into `po...', Array, Object(Closure))
#2 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php(411): Illuminate\Database\Connection->statement('insert into `po...', Array)
#3 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2646): Illuminate\Database\Connection->insert('insert into `po...', Array)
#4 /opt/librenms/includes/discovery/fdb-table.inc.php(64): Illuminate\Database\Query\Builder->insert(Array)
#5 /opt/librenms/includes/discovery/functions.inc.php(178): include('/opt/librenms/i...')
#6 /opt/librenms/discovery.php(121): discover_device(Array, false)
#7 {main}
Error in fdb-table module. SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'port_id' cannot be null (SQL: insert into `ports_fdb` (`port_id`, `mac_address`, `vlan_id`, `device_id`, `created_at`, `updated_at`) values (?, 743e2b369ce0, 18, 45, 2019-12-11 23:16:27, 2019-12-11 23:16:27))

Before this displayed instead of the stack trace. I’ve obscured the real VLANs and trimmed the bulk of the MAC addresses.

vlan 20 mac --------8d6d port (56)
vlan 20 mac --------0460 port (56)
vlan 30 mac --------8d77 port (74)
vlan 30 mac --------0456 port (74)

  n: ..
 20: ..................
 30: ...........
SQL[update `ports_fdb` set `updated_at` = ? where `ports_fdb_id` in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) ["2019-12-11 16:05:23",2568,2613,2569,2570,2571,2572,2573,2575,2629,2576,2577,2592,2578,2579,2595,2596,2626,2627,2581,2582,2583,2608,2632,2584,2585,2586,2587,2588,2589,2590,2591] 1.01ms]

The problem (not the insert w/ NULL above) I see is when the code in includes/discovery/fdb-table/bridge.inc.php uses Q-BRIDGE-MIB:dot1qTpFdbPort to obtain VLAN, MAC address, and port, the port is some handle that is translated by dot1dBasePortIfIndex.

vlan 20 mac --------8d6d port (56)
vlan 20 mac --------0460 port (56)
vlan 30 mac --------8d77 port (74)
vlan 30 mac --------0456 port (74)

$ snmpbulkwalk -v2c -c <community>@20 -OqsX -M mibs -m BRIDGE-MIB <sw-name> dot1dBasePortIfIndex
dot1dBasePortIfIndex[2] 1442
dot1dBasePortIfIndex[56] 24
$ snmpbulkwalk -v2c -c <community>@30 -OqsX -M mibs -m BRIDGE-MIB <sw-name> dot1dBasePortIfIndex
dot1dBasePortIfIndex[2] 1442
dot1dBasePortIfIndex[74] 42
$ snmpget -v2c -c <community> -OqsX -M mibs -m BRIDGE-MIB <sw-name> ifName.24
ifName[24] gigabitethernet0/0/23
$ snmpget -v2c -c <community> -OqsX -M mibs -m BRIDGE-MIB <sw-name> ifName.42
ifName[42] gigabitethernet0/0/41

(sw-name) #show mac-address-table | include 8d:6d
--:--:--:--:8d:6d  Learned       0020  GE0/0/23
(sw-name) #show mac-address-table | include 8d:77
--:--:--:--:8d:77  Learned       0030  GE0/0/41

Does anyone have any insight to the code or perhaps could recommend another forum so I can modify it to work on ArubaOS 7?

Thanks!