We upgraded telegraf from 1.19 to 1.20 and made the changes for SNMP traps. Now we have the curious situation where traps for some mibs are completely failing, and where traps in one mib some work, some don’t.
For the mib msa2000traps-mib, telegraf succeeds in decoding a received msaEventInfoTrap:
snmp_trap,community=public,host=mytest01,mib=MSA2000TRAPS-MIB,name=msaEventInfoTrap,objectClass=PWP,oid=.1.3.6.1.4.1.11.2.51.0.3001,source=127.0.0.1,version=2c sysUpTimeInstance=1279177305i,connUnitEventId=2i,connUnitEventType=2i,connUnitEventDescr=“A test” 1637842761561019393
But msaEventWarningTrap from same mib with similar data gives error in telegraf (and no metric):
2021-11-25T12:19:33Z E! [inputs.snmp_trap] Error resolving value OID, oid=.1.3.6.1.4.1.11.2.51.0.3002, source=127.0.0.1: Could not find node for OID 1.3.6.1.4.1.11.2.51.0.3002
snmptranslate (net-snmp) is still happy with the traps, but this is not used anymore.
snmptranslate .1.3.6.1.4.1.11.2.51.0.3002
MSA2000TRAPS-MIB::msaEventWarningTrap
Thanks for this, we know as it took quite some time to figure this one out… But we have the path already correctly set in telegraf.conf snmp_trap, so I doubt the path is the issue anymore.
path = ["/usr/share/snmp/mibs"]
Correct, no loading errors when starting telegraf, also when running telegraf in debug mode. The error that appears when the snmp_trap is received also remains the same, no additional info there, Error resolving value OID.
I believe this is an error from the gosmi library that is now doing the mib lookups. @Menno would you please post your config and I will see if I can pin down why this is happening.
The telegraf config for snmp_trap is very basic:
[[inputs.snmp_trap]]
service_address = “udp://0.0.0.0:162”
path = ["/usr/share/snmp/mibs"]
I have attached one of the offending mibs which is msa2000trap-mib and a parent mib FCMGMT-MIB. Guess the other parent RFC1155-SMI & RFC-1215 are by default in /usr/share/snmp/mibs. msa2000trap-mib.txt (4.7 KB) FCMGMT-MIB.txt (126.2 KB)
Is this mib in /usr/share/snmp/mibs for you? I have it in that folder and am not having the issue you are describing. My next best guess is that it is somewhere else and therefore not getting loaded in.
Hi @Mya ,
Yes, it was in /usr/share/snmp/mibs. I now also tried /usr/share/mibs , unclear which subsystem added those mibs as other machine we use don’t have this, but that didn’t work either…
I now see an error at startup of telegraf (happens for both directories) I didn’t spot earlier:
2021-12-02T09:21:05Z D! [agent] Initializing plugins
2021-12-02T09:21:06Z E! [inputs.snmp_trap] Module could not be loaded Could not load module at RFC-1212
The MIBs that I am using that fail are using RFC-1212… Could that be it? Doesn’t RFC-1212 fail in your environment?
The library is unable to parse RFC-1212 and that is why it is not getting loaded in. It seems there is a syntax issue in the mib. There is an issue open in the library for this exact issue. You can follow the issue here. Sorry for the confusion!