From 47e12d19811b36bbc7ed31aec70694356f9e4a1c Mon Sep 17 00:00:00 2001 From: Thomas Casteleyn Date: Wed, 24 Feb 2021 19:44:53 +0100 Subject: [PATCH] Support more snmpv3 authentication protocols (#8850) --- internal/snmp/wrapper.go | 8 ++++++++ plugins/inputs/snmp/README.md | 2 +- plugins/inputs/snmp/snmp.go | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/internal/snmp/wrapper.go b/internal/snmp/wrapper.go index 92c3442bb..9825d5677 100644 --- a/internal/snmp/wrapper.go +++ b/internal/snmp/wrapper.go @@ -112,6 +112,14 @@ func NewWrapper(s ClientConfig) (GosnmpWrapper, error) { sp.AuthenticationProtocol = gosnmp.MD5 case "sha": sp.AuthenticationProtocol = gosnmp.SHA + case "sha224": + sp.AuthenticationProtocol = gosnmp.SHA224 + case "sha256": + sp.AuthenticationProtocol = gosnmp.SHA256 + case "sha384": + sp.AuthenticationProtocol = gosnmp.SHA384 + case "sha512": + sp.AuthenticationProtocol = gosnmp.SHA512 case "": sp.AuthenticationProtocol = gosnmp.NoAuth default: diff --git a/plugins/inputs/snmp/README.md b/plugins/inputs/snmp/README.md index fa96150b9..0d52881a7 100644 --- a/plugins/inputs/snmp/README.md +++ b/plugins/inputs/snmp/README.md @@ -53,7 +53,7 @@ information. ## ## Security Name. # sec_name = "myuser" - ## Authentication protocol; one of "MD5", "SHA", or "". + ## Authentication protocol; one of "MD5", "SHA", "SHA224", "SHA256", "SHA384", "SHA512" or "". # auth_protocol = "MD5" ## Authentication password. # auth_password = "pass" diff --git a/plugins/inputs/snmp/snmp.go b/plugins/inputs/snmp/snmp.go index ee642a50e..df23eeeb7 100644 --- a/plugins/inputs/snmp/snmp.go +++ b/plugins/inputs/snmp/snmp.go @@ -56,7 +56,7 @@ const sampleConfig = ` ## ## Security Name. # sec_name = "myuser" - ## Authentication protocol; one of "MD5", "SHA", or "". + ## Authentication protocol; one of "MD5", "SHA", "SHA224", "SHA256", "SHA384", "SHA512" or "". # auth_protocol = "MD5" ## Authentication password. # auth_password = "pass"