fix(inputs.snmp): snmp UseUnconnectedUDPSocket when using udp (#10331)
This commit is contained in:
parent
a9e71eee8c
commit
1a47277298
|
|
@ -9,7 +9,8 @@ type ClientConfig struct {
|
||||||
Timeout config.Duration `toml:"timeout"`
|
Timeout config.Duration `toml:"timeout"`
|
||||||
Retries int `toml:"retries"`
|
Retries int `toml:"retries"`
|
||||||
// Values: 1, 2, 3
|
// Values: 1, 2, 3
|
||||||
Version uint8 `toml:"version"`
|
Version uint8 `toml:"version"`
|
||||||
|
UnconnectedUDPSocket bool `toml:"unconnected_udp_socket"`
|
||||||
// Path to mib files
|
// Path to mib files
|
||||||
Path []string `toml:"path"`
|
Path []string `toml:"path"`
|
||||||
// Translator implementation
|
// Translator implementation
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,8 @@ func NewWrapper(s ClientConfig) (GosnmpWrapper, error) {
|
||||||
|
|
||||||
gs.Retries = s.Retries
|
gs.Retries = s.Retries
|
||||||
|
|
||||||
|
gs.UseUnconnectedUDPSocket = s.UnconnectedUDPSocket
|
||||||
|
|
||||||
switch s.Version {
|
switch s.Version {
|
||||||
case 3:
|
case 3:
|
||||||
gs.Version = gosnmp.Version3
|
gs.Version = gosnmp.Version3
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,12 @@ path onto the global path variable
|
||||||
## SNMP version; can be 1, 2, or 3.
|
## SNMP version; can be 1, 2, or 3.
|
||||||
# version = 2
|
# version = 2
|
||||||
|
|
||||||
|
## Unconnected UDP socket
|
||||||
|
## When true, SNMP reponses are accepted from any address not just
|
||||||
|
## the requested address. This can be useful when gathering from
|
||||||
|
## redundant/failover systems.
|
||||||
|
# unconnected_udp_socket = false
|
||||||
|
|
||||||
## Path to mib files
|
## Path to mib files
|
||||||
## Used by the gosmi translator.
|
## Used by the gosmi translator.
|
||||||
## To add paths when translating with netsnmp, use the MIBDIRS environment variable
|
## To add paths when translating with netsnmp, use the MIBDIRS environment variable
|
||||||
|
|
@ -349,6 +355,10 @@ needed:
|
||||||
sudo tcpdump -s 0 -i eth0 -w telegraf-snmp.pcap host 127.0.0.1 and port 161
|
sudo tcpdump -s 0 -i eth0 -w telegraf-snmp.pcap host 127.0.0.1 and port 161
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Metrics
|
||||||
|
|
||||||
|
The field and tags will depend on the table and fields configured.
|
||||||
|
|
||||||
## Example Output
|
## Example Output
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue