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

     1  package inputs
     2  
     3  import (
     4  	"fmt"
     5  )
     6  
     7  // DiskIO is based on telegraf DiskIO.
     8  type DiskIO struct {
     9  	baseInput
    10  }
    11  
    12  // PluginName is based on telegraf plugin name.
    13  func (d *DiskIO) PluginName() string {
    14  	return "diskio"
    15  }
    16  
    17  // UnmarshalTOML decodes the parsed data to the object
    18  func (d *DiskIO) UnmarshalTOML(data interface{}) error {
    19  	return nil
    20  }
    21  
    22  // TOML encodes to toml string.
    23  func (d *DiskIO) TOML() string {
    24  	return fmt.Sprintf(`[[inputs.%s]]
    25    ## By default, telegraf will gather stats for all devices including
    26    ## disk partitions.
    27    ## Setting devices will restrict the stats to the specified devices.
    28    # devices = ["sda", "sdb", "vd*"]
    29    ## Uncomment the following line if you need disk serial numbers.
    30    # skip_serial_number = false
    31    #
    32    ## On systems which support it, device metadata can be added in the form of
    33    ## tags.
    34    ## Currently only Linux is supported via udev properties. You can view
    35    ## available properties for a device by running:
    36    ## 'udevadm info -q property -n /dev/sda'
    37    ## Note: Most, but not all, udev properties can be accessed this way. Properties
    38    ## that are currently inaccessible include DEVTYPE, DEVNAME, and DEVPATH.
    39    # device_tags = ["ID_FS_TYPE", "ID_FS_USAGE"]
    40    #
    41    ## Using the same metadata source as device_tags, you can also customize the
    42    ## name of the device via templates.
    43    ## The 'name_templates' parameter is a list of templates to try and apply to
    44    ## the device. The template may contain variables in the form of '$PROPERTY' or
    45    ## '${PROPERTY}'. The first template which does not contain any variables not
    46    ## present for the device is used as the device name tag.
    47    ## The typical use case is for LVM volumes, to get the VG/LV name instead of
    48    ## the near-meaningless DM-0 name.
    49    # name_templates = ["$ID_FS_LABEL","$DM_VG_NAME/$DM_LV_NAME"]
    50  `, d.PluginName())
    51  }