diff --git a/plugins/inputs/net/README.md b/plugins/inputs/net/README.md index 73a460590..1309584d7 100644 --- a/plugins/inputs/net/README.md +++ b/plugins/inputs/net/README.md @@ -27,8 +27,10 @@ See the [CONFIGURATION.md][CONFIGURATION.md] for more details. ## On linux systems telegraf also collects protocol stats. ## Setting ignore_protocol_stats to true will skip reporting of protocol metrics. ## + ## DEPRECATION NOTICE: A value of 'false' is deprecated and discouraged! + ## Please set this to `true` and use the 'inputs.nstat' + ## plugin instead. # ignore_protocol_stats = false - ## ``` ## Metrics diff --git a/plugins/inputs/net/net.go b/plugins/inputs/net/net.go index 22016f751..78dc7d63a 100644 --- a/plugins/inputs/net/net.go +++ b/plugins/inputs/net/net.go @@ -9,6 +9,7 @@ import ( "github.com/influxdata/telegraf" "github.com/influxdata/telegraf/filter" + "github.com/influxdata/telegraf/models" "github.com/influxdata/telegraf/plugins/inputs" "github.com/influxdata/telegraf/plugins/inputs/system" ) @@ -29,6 +30,20 @@ func (*NetIOStats) SampleConfig() string { return sampleConfig } +func (n *NetIOStats) Init() error { + if !n.IgnoreProtocolStats { + models.PrintOptionValueDeprecationNotice(telegraf.Warn, "inputs.net", "ignore_protocol_stats", "false", + telegraf.DeprecationInfo{ + Since: "1.27.3", + RemovalIn: "1.36.0", + Notice: "use the 'inputs.nstat' plugin instead", + }, + ) + } + + return nil +} + func (n *NetIOStats) Gather(acc telegraf.Accumulator) error { netio, err := n.ps.NetIO() if err != nil { diff --git a/plugins/inputs/net/sample.conf b/plugins/inputs/net/sample.conf index e7e3c8db7..4e06e6cef 100644 --- a/plugins/inputs/net/sample.conf +++ b/plugins/inputs/net/sample.conf @@ -10,5 +10,7 @@ ## On linux systems telegraf also collects protocol stats. ## Setting ignore_protocol_stats to true will skip reporting of protocol metrics. ## + ## DEPRECATION NOTICE: A value of 'false' is deprecated and discouraged! + ## Please set this to `true` and use the 'inputs.nstat' + ## plugin instead. # ignore_protocol_stats = false - ##