github.com/influxdata/influxdb/v2@v2.7.6/telegraf/plugins/inputs/net.go (about)

     1  package inputs
     2  
     3  import (
     4  	"fmt"
     5  )
     6  
     7  // NetIOStats is based on telegraf NetIOStats.
     8  type NetIOStats struct {
     9  	baseInput
    10  }
    11  
    12  // PluginName is based on telegraf plugin name.
    13  func (n *NetIOStats) PluginName() string {
    14  	return "net"
    15  }
    16  
    17  // TOML encodes to toml string
    18  func (n *NetIOStats) TOML() string {
    19  	return fmt.Sprintf(`[[inputs.%s]]
    20    ## By default, telegraf gathers stats from any up interface (excluding loopback)
    21    ## Setting interfaces will tell it to gather these explicit interfaces,
    22    ## regardless of status.
    23    ##
    24    # interfaces = ["eth0"]
    25    ##
    26    ## On linux systems telegraf also collects protocol stats.
    27    ## Setting ignore_protocol_stats to true will skip reporting of protocol metrics.
    28    ##
    29    # ignore_protocol_stats = false
    30    ##
    31  `, n.PluginName())
    32  }
    33  
    34  // UnmarshalTOML decodes the parsed data to the object
    35  func (n *NetIOStats) UnmarshalTOML(data interface{}) error {
    36  	return nil
    37  }