feat(agent): Deprecate active usage of netsnmp translator (#12358)

This commit is contained in:
Thomas Casteleyn 2022-12-08 15:18:09 +01:00 committed by GitHub
parent 8d78c5fbdc
commit c883673cdb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 3 deletions

View File

@ -84,7 +84,7 @@
## If set to true, do no set the "host" tag in the telegraf agent.
omit_hostname = false
## Method of translating SNMP objects. Can be "netsnmp" which
## Method of translating SNMP objects. Can be "netsnmp" (deprecated) which
## translates by calling external programs snmptranslate and snmptable,
## or "gosmi" which translates using the built-in gosmi library.
# snmp_translator = "netsnmp"

View File

@ -458,6 +458,14 @@ func (c *Config) LoadConfigData(data []byte) error {
c.Tags["host"] = c.Agent.Hostname
}
// Warn when explicitly setting the old snmp translator
if c.Agent.SnmpTranslator == "netsnmp" {
models.PrintOptionValueDeprecationNotice(telegraf.Warn, "agent", "snmp_translator", "netsnmp", telegraf.DeprecationInfo{
Since: "1.25.0",
RemovalIn: "2.0.0",
Notice: "Use 'gosmi' instead",
})
}
// Set snmp agent translator default
if c.Agent.SnmpTranslator == "" {
c.Agent.SnmpTranslator = "netsnmp"

View File

@ -263,8 +263,8 @@ The agent table configures Telegraf and the defaults used across all plugins.
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,
Method of translating SNMP objects. Can be "netsnmp" (deprecated) which
translates by calling external programs `snmptranslate` and `snmptable`,
or "gosmi" which translates using the built-in gosmi library.
## Plugins