From c883673cdbe4865ad00b8578dad7b6406ef5b6e7 Mon Sep 17 00:00:00 2001 From: Thomas Casteleyn Date: Thu, 8 Dec 2022 15:18:09 +0100 Subject: [PATCH] feat(agent): Deprecate active usage of netsnmp translator (#12358) --- cmd/telegraf/agent.conf | 2 +- config/config.go | 8 ++++++++ docs/CONFIGURATION.md | 4 ++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/cmd/telegraf/agent.conf b/cmd/telegraf/agent.conf index d674e9c01..9e9886b4a 100644 --- a/cmd/telegraf/agent.conf +++ b/cmd/telegraf/agent.conf @@ -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" diff --git a/config/config.go b/config/config.go index 52c91fec0..403a46ef7 100644 --- a/config/config.go +++ b/config/config.go @@ -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" diff --git a/docs/CONFIGURATION.md b/docs/CONFIGURATION.md index 642b6e959..bd1157779 100644 --- a/docs/CONFIGURATION.md +++ b/docs/CONFIGURATION.md @@ -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