Skip to content
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: deprecate unused snmp_trap timeout configuration option #10339

Merged
merged 3 commits into from
Jan 10, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions plugins/inputs/snmp_trap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ path onto the global path variable
## Path to mib files
# path = ["/usr/share/snmp/mibs"]
##
## Timeout running snmptranslate command
# timeout = "5s"
## Snmp version
# version = "2c"
## SNMPv3 authentication and encryption options.
Expand Down
7 changes: 1 addition & 6 deletions plugins/inputs/snmp_trap/snmp_trap.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@ import (
"github.com/gosnmp/gosnmp"
)

var defaultTimeout = config.Duration(time.Second * 5)

type SnmpTrap struct {
ServiceAddress string `toml:"service_address"`
Timeout config.Duration `toml:"timeout"`
Timeout config.Duration `toml:"timeout" deprecated:"1.20.0;unused option"`
powersj marked this conversation as resolved.
Show resolved Hide resolved
Version string `toml:"version"`
Path []string `toml:"path"`

Expand Down Expand Up @@ -58,8 +56,6 @@ var sampleConfig = `
## Path to mib files
# path = ["/usr/share/snmp/mibs"]
##
## Timeout running snmptranslate command
# timeout = "5s"
## Snmp version, defaults to 2c
# version = "2c"
## SNMPv3 authentication and encryption options.
Expand Down Expand Up @@ -96,7 +92,6 @@ func init() {
timeFunc: time.Now,
lookupFunc: snmp.TrapLookup,
ServiceAddress: "udp://:162",
Timeout: defaultTimeout,
Path: []string{"/usr/share/snmp/mibs"},
Version: "2c",
}
Expand Down