fix: change name of snmp translator setting (#10872)
This commit is contained in:
parent
baea38970e
commit
d8bd44abe1
15
CHANGELOG.md
15
CHANGELOG.md
|
|
@ -2,6 +2,21 @@
|
||||||
|
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## v1.22.0
|
||||||
|
|
||||||
|
This version introduces an agent setting to select the method of
|
||||||
|
translating SNMP objects. The agent setting "snmp_translator" can be
|
||||||
|
"netsnmp" which translates by calling external programs snmptranslate
|
||||||
|
and snmptable, or "gosmi" which translates using the built-in gosmi
|
||||||
|
library.
|
||||||
|
|
||||||
|
Before version 1.21.0, Telegraf only used the netsnmp method. Versions
|
||||||
|
1.21.0 through 1.21.4 only used the gosmi method. Since the
|
||||||
|
translation method is now configurable and "netsnmp" is the default,
|
||||||
|
users who wish to continue using "gosmi" must add `snmp_translator =
|
||||||
|
"gosmi"` in the agent section of their config file. See
|
||||||
|
[#10802](https://github.com/influxdata/telegraf/pull/10802).
|
||||||
|
|
||||||
## v1.21.4 [2022-02-16]
|
## v1.21.4 [2022-02-16]
|
||||||
|
|
||||||
### Bugfixes
|
### Bugfixes
|
||||||
|
|
|
||||||
|
|
@ -189,7 +189,7 @@ func (a *Agent) initPlugins() error {
|
||||||
for _, input := range a.Config.Inputs {
|
for _, input := range a.Config.Inputs {
|
||||||
// Share the snmp translator setting with plugins that need it.
|
// Share the snmp translator setting with plugins that need it.
|
||||||
if tp, ok := input.Input.(snmp.TranslatorPlugin); ok {
|
if tp, ok := input.Input.(snmp.TranslatorPlugin); ok {
|
||||||
tp.SetTranslator(a.Config.Agent.Translator)
|
tp.SetTranslator(a.Config.Agent.SnmpTranslator)
|
||||||
}
|
}
|
||||||
err := input.Init()
|
err := input.Init()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
|
|
@ -226,7 +226,9 @@ type AgentConfig struct {
|
||||||
Hostname string
|
Hostname string
|
||||||
OmitHostname bool
|
OmitHostname bool
|
||||||
|
|
||||||
Translator string `toml:"translator"`
|
// Method for translating SNMP objects. 'netsnmp' to call external programs,
|
||||||
|
// 'gosmi' to use the built-in library.
|
||||||
|
SnmpTranslator string `toml:"snmp_translator"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// InputNames returns a list of strings of the configured inputs.
|
// InputNames returns a list of strings of the configured inputs.
|
||||||
|
|
@ -421,10 +423,10 @@ var agentConfig = `
|
||||||
## If set to true, do no set the "host" tag in the telegraf agent.
|
## If set to true, do no set the "host" tag in the telegraf agent.
|
||||||
omit_hostname = false
|
omit_hostname = false
|
||||||
|
|
||||||
## Translator for SNMP OIDs
|
## Method of translating SNMP objects. Can be "netsnmp" which
|
||||||
## Valid values are "netsnmp" which runs snmptranslate and snmptable,
|
## translates by calling external programs snmptranslate and snmptable,
|
||||||
## and "gosmi" which uses the gosmi library.
|
## or "gosmi" which translates using the built-in gosmi library.
|
||||||
# translator = "netsnmp"
|
# snmp_translator = "netsnmp"
|
||||||
`
|
`
|
||||||
|
|
||||||
var outputHeader = `
|
var outputHeader = `
|
||||||
|
|
@ -863,8 +865,8 @@ func (c *Config) LoadConfigData(data []byte) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set snmp agent translator default
|
// Set snmp agent translator default
|
||||||
if c.Agent.Translator == "" {
|
if c.Agent.SnmpTranslator == "" {
|
||||||
c.Agent.Translator = "netsnmp"
|
c.Agent.SnmpTranslator = "netsnmp"
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(c.UnusedFields) > 0 {
|
if len(c.UnusedFields) > 0 {
|
||||||
|
|
|
||||||
|
|
@ -242,9 +242,15 @@ The agent table configures Telegraf and the defaults used across all plugins.
|
||||||
|
|
||||||
- **hostname**:
|
- **hostname**:
|
||||||
Override default hostname, if empty use os.Hostname()
|
Override default hostname, if empty use os.Hostname()
|
||||||
|
|
||||||
- **omit_hostname**:
|
- **omit_hostname**:
|
||||||
If set to true, do no set the "host" tag in the telegraf agent.
|
If set to true, do no set the "host" tag in the telegraf agent.
|
||||||
|
|
||||||
|
- **snmp_translator**:
|
||||||
|
Method of translating SNMP objects. Can be "netsnmp" which
|
||||||
|
translates by calling external programs snmptranslate and snmptable,
|
||||||
|
or "gosmi" which translates using the built-in gosmi library.
|
||||||
|
|
||||||
## Plugins
|
## Plugins
|
||||||
|
|
||||||
Telegraf plugins are divided into 4 types: [inputs][], [outputs][],
|
Telegraf plugins are divided into 4 types: [inputs][], [outputs][],
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue