-
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
feat(inputs.snmp): Convert octet string with invalid data to hex #15439
feat(inputs.snmp): Convert octet string with invalid data to hex #15439
Conversation
7b85c4f
to
5c20bac
Compare
This comment was marked as outdated.
This comment was marked as outdated.
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.
Thanks for your contribution @Hipska!
Download PR build artifacts for linux_amd64.tar.gz, darwin_arm64.tar.gz, and windows_amd64.zip. 📦 Click here to get additional PR build artifactsArtifact URLs |
Summary
Some snmp data is binary encoded and displayed as HEX string with net-snmp tools (
Hex-STRING: 84 C8 07 FF FD 38 54 C1
). Currently Telegraf tries to interpret these bytes as string and thus resulting in non-printable characters:raw="����8T�"
.This PR changes this so that they will be converted to HEX in the case of OctetString and containing not valid UTF8 characters, resulting in
raw="84c807fffd3854c1"
. Similar fix has been done forinputs.snmp_trap
: #14619.Meanwhile I also added a new field
conversion
option so you can force to always convert the value to HEX string.Checklist
Related issues
related to #14619
resolves #12456
resolves #3716
resolves #3478