Skip to content

Commit

Permalink
change #1074 broke SNMPv3 by removing the lines that need to go in co…
Browse files Browse the repository at this point in the history
…nfig.go after 155 and 171 respectively:

usm.AuthenticationPassphrase = string(c.Password)

and

usm.PrivacyPassphrase = string(c.PrivPassword)

after adding the back in to the code, I tried running with having variables set via environment and in the snmp.yml and both worked. without them I was getting the error:

securityParameter.PrivacyPassphrase is required when a privacy protocol is specified

Signed-off-by: Robert Bergman <[email protected]>
  • Loading branch information
RobertBergman committed Feb 26, 2024
1 parent 3d4e413 commit dea0399
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ func (c Auth) ConfigureSNMP(g *gosnmp.GoSNMP) {
priv = true
}
if auth {
usm.AuthenticationPassphrase = string(c.Password)
switch c.AuthProtocol {
case "SHA":
usm.AuthenticationProtocol = gosnmp.SHA
Expand All @@ -169,6 +170,7 @@ func (c Auth) ConfigureSNMP(g *gosnmp.GoSNMP) {
}
}
if priv {
usm.PrivacyPassphrase = string(c.PrivPassword)
switch c.PrivProtocol {
case "DES":
usm.PrivacyProtocol = gosnmp.DES
Expand Down

0 comments on commit dea0399

Please sign in to comment.