-
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(snmp): Add secret support for auth_password and priv_password #14975
Conversation
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 |
Hi, it is not really working. This is my telegraf.conf with the secrets config (this one is working fine with "<< token = "@{localsecrets:influxdb_token}" >>"for influx): [[secretstores.jose]]
id = "localsecrets"
path = "/etc/telegraf/secrets"
password = "xxxx" $ telegraf secrets list
Known secrets for store "localsecrets":
influxdb_token
snmpv3_operator_token
snmpv3_token [[inputs.snmp]]
...
auth_protocol = "SHA"
auth_password = "@{localsecrets:snmpv3_token}"
priv_protocol = "AES"
priv_password = "@{localsecrets:snmpv3_token}" $telegraf --test --config /etc/telegraf/telegraf.d/snmp.conf.test
2024-03-12T12:52:16Z I! Loading config: /etc/telegraf/telegraf.d/snmp.conf.test
2024-03-12T12:52:16Z E! unknown secret-store for "@{localsecrets:snmpv3_token}" |
Ignore the above ... It is working fine, I forgot to add the telegraf config (where the secretstore is defined) in the test $telegraf --test --config /etc/telegraf/telegraf.conf --config /etc/telegraf/telegraf.d/snmp.conf.test |
if !s.PrivPassword.Empty() { | ||
p, err := s.PrivPassword.Get() | ||
if err != nil { | ||
return GosnmpWrapper{}, fmt.Errorf("getting private password failed: %w", err) |
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.
- return GosnmpWrapper{}, fmt.Errorf("getting private password failed: %w", err)
+ return GosnmpWrapper{}, fmt.Errorf("getting privacy password failed: %w", err)
Summary
Add support for secrets to all SNMP-family plugins.
Checklist
Related issues
resolves #14972