-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
input: snmp_trap: only one v3 config can be used #13414
Comments
Hi, Thanks for the issue. It does look to be related to the upstream issue. However, I am a little concerned that issue has not had any updates in 2+ years. Would you might asking if there is any PR or work that was completed to resolve that issue? Thanks |
Not really sure the referenced issue is really relevant here. As in this case we are talking about initiating multiple trap listeners. It seems that it actually isn't really supported to launch 3 separate ones in the same application.. |
Changing the snmp_trap.go code as per below, then using the latest code from gosnmp, seems to resolve the problem.
|
@mark-chandler okay great! Can you put this in a PR? Then you will get full credit of fixing this bug.. |
Relevant telegraf.conf
Logs from Telegraf
System info
Telegraf 1.26.3, Fedora Linux 38, Podman 4.5.1
Docker
podman run
-p 1162:1162/udp
-p 10162:10162/udp
-p 10262:10262/udp
-p 10362:10362/udp
--expose=1162,10162,10262,10362
-u "telegraf"
-v $PWD/etc/telegraf:/etc/telegraf:Z
-v /usr/share/snmp/mibs:/usr/share/snmp/mibs:ro
-v $PWD/tmp:/tmp:Z
telegraf
telegraf --config /etc/telegraf/telegraf.conf
Steps to reproduce
$ snmptrap -v 3 -u "sourcenumber1" -a SHA -A "sourcenumber1" -l authPriv -x AES256 -X "SourceNumber1" localhost:10162 41 coldStart.0
$ snmptrap -v 3 -u "sourcenumber2" -a SHA -A "sourcenumber2" -l authPriv -x AES256 -X "SourceNumber2" localhost:10262 42 coldStart.0
$ snmptrap -v 3 -u "sourcenumber3" -a SHA -A "sourcenumber3" -l authPriv -x AES256 -X "SourceNumber3" localhost:10262 43 coldStart.0
$ snmptrap -v 3 -u "sourcenumber3" -a SHA -A "sourcenumber3" -l authPriv -x AES256 -X "SourceNumber3" localhost:10162 43 coldStart.0
$ snmptrap -v 3 -u "sourcenumber3" -a SHA -A "sourcenumber3" -l authPriv -x AES256 -X "SourceNumber3" localhost:10262 43 coldStart.0
Expected behavior
Three traps should be received, one for each SNMPv3 input defined.
Actual behavior
All the SNMPv3 inputs will accept traps with the credentials for the last SNMPv3 input.
But any other SNMPv3 input will not accept traps with their credentials.
So, listeners 1, 2, 3 will accept traps with credentials for 3, but not 1 or 2.
Additional info
Wondering if this maybe related to gosnmp/gosnmp#302
Discussed at https://influxcommunity.slack.com/archives/CH99HUH8V/p1685961051007439
The text was updated successfully, but these errors were encountered: