telegraf/plugins/inputs/ethtool/ethtool.go

38 lines
770 B
Go
Raw Normal View History

2019-11-09 03:55:37 +08:00
package ethtool
import (
"net"
"github.com/influxdata/telegraf"
2019-11-09 03:55:37 +08:00
)
type Command interface {
Init() error
DriverName(intf string) (string, error)
Interfaces() ([]net.Interface, error)
Stats(intf string) (map[string]uint64, error)
}
type Ethtool struct {
// This is the list of interface names to include
InterfaceInclude []string `toml:"interface_include"`
// This is the list of interface names to ignore
InterfaceExclude []string `toml:"interface_exclude"`
// Normalization on the key names
NormalizeKeys []string `toml:"normalize_keys"`
Log telegraf.Logger `toml:"-"`
2019-11-09 03:55:37 +08:00
// the ethtool command
command Command
}
const (
pluginName = "ethtool"
tagInterface = "interface"
tagDriverName = "driver"
fieldInterfaceUp = "interface_up"
2019-11-09 03:55:37 +08:00
)