I’m having trouble writing an OS definition for a device with what I believe to be a badly-written MIB, but this has exposed some differences between the poller and the discovery code. When I run the discovery code, the sensors are discovered and the current values are set. However, the poller always returns an undefined value for these sensors.
Looking at the debug code for the poller, I see the following:
SNMP['/usr/bin/snmpget' '-v2c' '-c' 'COMMUNITY' '-OUQnte' '-M' '/opt/librenms/mibs:/opt/librenms/mibs/Fiberroad' 'udp:HOSTNAME:161' '.1.3.6.1.4.1.6688.1.1.1.2.1.2.master']
.1.3.6.1.4.1.6688.1.1.1.2.1.2.master: Unknown Object Identifier (Sub-id not found: enterprises -> master)
I’m pretty sure it’s this “.master” causing the problem - most tables I’ve seen in MIBs always have an index as their first column. On this one, the first column returns the name of the row (master in this case) which is then being used by the poller.
SNMP['/usr/bin/snmpbulkwalk' '-v2c' '-c' 'COMMUNITY' '-OteQUs' '-Ih' '-m' 'XXX-MIB' '-M' '/opt/librenms/mibs:/opt/librenms/mibs/Fiberroad' 'udp:HOSTNAME:161' 'shelfTable']
shelfName.master = 1
psuA.master = 1
psuB.master = 1
...
Compare this to ifTable, of which the first column is an index:
IF-MIB::ifIndex.1 = INTEGER: 1
IF-MIB::ifIndex.2 = INTEGER: 2
IF-MIB::ifIndex.3 = INTEGER: 3
...
Adding the specific sensors by OID is not an option either, since this device has multiple shelves so it must be possible to re-run discovery to find new sensors. The MIB in question can be seen at http://www.circitor.fr/Mibs/Html/X/XXX-MIB.php
Any suggestions on how to handle this type of index?