-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Resolve Traps OIDs to names #10934
Resolve Traps OIDs to names #10934
Conversation
603f0db
to
2091d5a
Compare
e505625
to
dcc8084
Compare
"testing" | ||
|
||
"github.com/gosnmp/gosnmp" | ||
"github.com/stretchr/testify/assert" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
var serverPort = getFreePort() | ||
|
||
func getFreePort() uint16 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prevent flakiness
72ed2d2
to
2febe4c
Compare
2febe4c
to
ef554d3
Compare
func formatVersion(packet *gosnmp.SnmpPacket) string { | ||
switch packet.Version { | ||
case gosnmp.Version3: | ||
return "3" | ||
case gosnmp.Version2c: | ||
return "2" | ||
case gosnmp.Version1: | ||
return "1" | ||
default: | ||
return "unknown" | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(no blocking for this PR since it was already there)
Do we need to report the SNMP version ?
Not sure if that's useful info, it's more related to the kind of credentials used (v2 community string, v3 user model) and not really part of the trap information. Also, a same device can support both v2 community string and v3 user model.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't want to change it in this PR. Do you think we should remove it?
The version doesn't provide I agree but it doesn't harm to have it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as #10934 (comment)
Co-authored-by: Alexandre Yang <[email protected]>
With this PRs traps payload format has been refactored:
snmp-traps
..raw_variables
instead of.variables
.snmp.d/traps_db/
How to test:
snmp.d/traps_db/
directory (you can leave it compressed).datadog.yaml
snmptrap -v2c -c public localhost:9162 '' IF-MIB::linkDown ifIndex i 12 ifAdminStatus i 1 ifOperStatus i 2