Show platform not supported warning only on plugin creation (#6801)
This commit is contained in:
@@ -2,6 +2,8 @@ package ethtool
|
||||
|
||||
import (
|
||||
"net"
|
||||
|
||||
"github.com/influxdata/telegraf"
|
||||
)
|
||||
|
||||
type Command interface {
|
||||
@@ -18,6 +20,8 @@ type Ethtool struct {
|
||||
// This is the list of interface names to ignore
|
||||
InterfaceExclude []string `toml:"interface_exclude"`
|
||||
|
||||
Log telegraf.Logger `toml:"-"`
|
||||
|
||||
// the ethtool command
|
||||
command Command
|
||||
}
|
||||
|
||||
@@ -3,19 +3,21 @@
|
||||
package ethtool
|
||||
|
||||
import (
|
||||
"log"
|
||||
|
||||
"github.com/influxdata/telegraf"
|
||||
"github.com/influxdata/telegraf/plugins/inputs"
|
||||
)
|
||||
|
||||
func (e *Ethtool) Init() error {
|
||||
e.Log.Warn("Current platform is not supported")
|
||||
return nil
|
||||
}
|
||||
|
||||
func (e *Ethtool) Gather(acc telegraf.Accumulator) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
inputs.Add(pluginName, func() telegraf.Input {
|
||||
log.Print("W! [inputs.ethtool] Current platform is not supported")
|
||||
return &Ethtool{}
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user