racktables
racktables copied to clipboard
more ubiquiti and sharing sysObjectID between devices
I think I committed my previous PR #184 too soon.
I just got a different model Ubiquiti switch and noticed they have the same sysObjectID.
.1.3.6.1.2.1.1.2.0 = OID: .1.3.6.1.4.1.4413
# snmpwalk -On -v 2c -c ** 10.10.14.196 sysObjectID.0
.1.3.6.1.2.1.1.2.0 = OID: .1.3.6.1.4.1.4413
# snmpwalk -On -v 2c -c ** 172.20.10.20 sysDescr.0
.1.3.6.1.2.1.1.1.0 = STRING: EdgeSwitch 48-Port Lite, 1.6.0.4900860, Linux 3.6.5-f4a26ed5, 1.0.0.4857129
# snmpwalk -On -v 2c -c public 10.10.14.196 sysDescr.0
.1.3.6.1.2.1.1.1.0 = STRING: EdgeSwitch 16-Port 10G, 1.6.0.4900860, Linux 3.6.5, 1.0.0.4872137
So I hacked up the code a bit and added what I think could work in this situation for any manufacturer. I do know that I tried to make it manufacturer agnostic and the code does work fine.
Some obvious cleanups are due, but other than that maybe @adoom42 has an opinion about the proposed change?
It looks like a novel approach which adds support for new models without affecting any existing ones. Once the code is adjusted for style/formatting standards, I'd merge it.
It may be simpler to keep the vendor-specific files as snmp-VENDOR.php
(or likewise) in the usual directory, this way the custom pathname processing will not be required.