SNMP MIB association/ potential bug?

Hi,
I was looking at some of my (network) devices (MIB association tab) and found that there were no MIBs associated with them. In particular these are Cisco Small business switches. I was digging into this to find out why the box does not see some of the interesting data points which i’d expect to be exposed via SNMP (specifically temperature atm)

So I looked around a bit and found Problem loading correct mibs? · Issue #3562 · librenms/librenms · GitHub.

Based on the info in there I ran a similar check and found that the new -IR switch seems to prevent snmptranslate to work properly…


./discovery.php -h ciscosg350xgk -d -m os
LibreNMS Discovery
SQL[SELECT version FROM dbSchema ORDER BY version DESC LIMIT 1]
SQL[SELECT version()]

Version info:
Commit SHA: 07d07725954e6886c0723d234612c3f9bd447f61
Commit Date: 1532781837
DB Schema: 256
PHP: 7.0.30-0ubuntu0.16.04.1
MySQL: 10.0.34-MariaDB-0ubuntu0.16.04.1
RRDTool: 1.5.5
SNMP: NET-SNMP 5.7.3
==================================DEBUG!
Updating os_def.cache… Done
Override discovery modules: os
SQL[SELECT * FROM devices WHERE disabled = 0 AND snmp_disable = 0 AND hostname LIKE ‘ciscosg350xgk’ ORDER BY device_id DESC]
SQL[SELECT * FROM devices_attribs WHERE device_id = ‘57’]
ciscosg350xgk 57 ciscosb SQL[INSERT INTO device_perf (xmt,rcv,loss,min,max,avg,device_id,timestamp) VALUES (‘3’,‘3’,‘0’,‘1.05’,‘1.56’,‘1.23’,‘57’,NOW())]
SNMP Check response code: 0
SQL[SELECT attrib_value FROM devices_attribs WHERE device_id = ‘57’ AND attrib_type = ‘poll_mib’ ]
MIB: registering

Attempting to initialize OS: ciscosb
OS initilized as Generic

Modules status: Global+ OS Device

Load disco module core

SNMP[/usr/bin/snmpget -v2c -c COMMUNITY -OUQn -m SNMPv2-MIB -M /opt/librenms/mibs:/opt/librenms/mibs/cisco udp:HOSTNAME:161 sysName.0 sysObjectID.0 sysDescr.0]
Expected LAST-UPDATED (SMI): At line 35 in /opt/librenms/mibs/cisco/SNMPv2-SMI.my
...0 = CISCOSG350XGK
...0 = ...*
...0 = SG350XG-2F10 12-Port 10G Stackable Managed Switch

Runtime for discovery module ‘core’: 0.0080 seconds with 1072 bytes
SNMP: [2/0.02s] MySQL: [8/0.00s] RRD: [0/0.00s]

Unload disco module core

Modules status: Global+ OS+ Device

Load disco module os

SNMP[/usr/bin/snmpget -v2c -c COMMUNITY -Ovq -M /opt/librenms/mibs:/opt/librenms/mibs/cisco udp:HOSTNAME:161 SNMPv2-MIB::sysDescr.0]
Expected LAST-UPDATED (SMI): At line 35 in /opt/librenms/mibs/cisco/SNMPv2-SMI.my
SG350XG-2F10 12-Port 10G Stackable Managed Switch

SNMP[/usr/bin/snmpget -v2c -c COMMUNITY -Ovqn -M /opt/librenms/mibs:/opt/librenms/mibs/cisco udp:HOSTNAME:161 SNMPv2-MIB::sysObjectID.0]
Expected LAST-UPDATED (SMI): At line 35 in /opt/librenms/mibs/cisco/SNMPv2-SMI.my
...*

| SG350XG-2F10 12-Port 10G Stackable Managed Switch | .1.3.6.1.4.1.9.6.1.91.12.9 |
OS: Cisco Small Business (ciscosb)

Runtime for discovery module ‘os’: 0.0150 seconds with 1368 bytes
SNMP: [2/0.02s] MySQL: [0/0.00s] RRD: [0/0.00s]

Unload disco module os

SQL[SELECT attrib_value FROM devices_attribs WHERE device_id = ‘57’ AND attrib_type = ‘poll_mib’ ]
SQL[SELECT attrib_value FROM devices_attribs WHERE device_id = ‘57’ AND attrib_type = ‘poll_mib’ ]
MIB: registering
SNMP[snmptranslate -M /opt/librenms/mibs:/opt/librenms/mibs/cisco -IR -m all .1.3.6.1.4.1.9.6.1.91.12.9 2>/dev/null]

This doesn’t look like a MIB:
MIB: Could not find all::.1.3.6.1.4.1.9.6.1.91.12.9

SQL[UPDATE devices set last_discovered =NOW(),last_discovered_timetaken =‘1.239’ WHERE device_id = ‘57’]
Discovered in 1.239 seconds

SQL[INSERT INTO perf_times (type,doing,start,duration,devices,poller) VALUES (‘discover’,‘ciscosg350xgk’,‘1532885768.4307’,‘1.368’,‘1’,‘LibreNMS’)]
./discovery.php ciscosg350xgk 2018-07-29 19:36:09 - 1 devices discovered in 1.368 secs
SNMP [4/0.03s]: Get[4/0.03s] Getnext[0/0.00s] Walk[0/0.00s]
MySQL [12/0.01s]: Cell[2/0.00s] Row[3/0.00s] Rows[4/0.00s] Column[0/0.00s] Update[1/0.00s] Insert[2/0.00s] Delete[0/0.00s]
RRD [0/0.00s]: Update[0/0.00s] Create [0/0.00s] Other[0/0.00s]


snmptranslate -M /opt/librenms/mibs:/opt/librenms/mibs/cisco -m all .1.3.6.1.4.1.9.6.1.91.12.9 2>/dev/null
CISCO-SMI::ciscoSB.91.12.9
snmptranslate -M /opt/librenms/mibs:/opt/librenms/mibs/cisco -IR -m all .1.3.6.1.4.1.9.6.1.91.12.9 2>/dev/null

./validate.php

Component Version
LibreNMS 1.41-67-g58e331c
DB Schema 256
PHP 7.0.30-0ubuntu0.16.04.1
MySQL 10.0.34-MariaDB-0ubuntu0.16.04.1
RRDTool 1.5.5
SNMP NET-SNMP 5.7.3
====================================

[OK] Composer Version: 1.6.5
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database schema correct

Is that a mistake on my side?
Thanks

edit: sorry for the weird formatting, not sure how to clean that up :frowning:

Nobody got an idea/opinion whether thats intentional or a bug?