Telegraf 1.20.4 some SNMP traps failing whilst no issues with 1.18

Hello,

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

There are no startup errors for telegraf.

Best Regards,
Menno

You need to specify the mib path, that will be fixed in next release…

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"]

Also no loading errors when running telegraf in debug mode?

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.

@Mya Do you have an idea what might be wrong in this case?

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.

Hi @Mya ,

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)

If you need more information, please let me know.

Best Regards,
Menno

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?

Best Regards,
Menno

@Menno,

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!

Whoa same problem I was having as well. Would you both mind to reply on that issue, so it might get fixed faster by its maintainers?

Hi @Mya ,
The issue was fixed in the gosmi library.

Could you incorporate the fixed gosmi lib in telegraf?

1 Like

We will look into it! Thanks for following up :slight_smile:

Thanks @Mya , would you have an idea of when this will be in telegraf? I saw the latest telegraf had an update of gosnmp but not yet gosmi.

It will be in the next release: chore: Update gosmi by Hipska · Pull Request #10686 · influxdata/telegraf · GitHub

1 Like

Tested telegraf 1.22 with a few “old” MIBs that failed on 1.20.4, it is working fine now!

1 Like