52 lines
1.8 KiB
Go
52 lines
1.8 KiB
Go
package inputs
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
// DiskIO is based on telegraf DiskIO.
|
|
type DiskIO struct {
|
|
baseInput
|
|
}
|
|
|
|
// PluginName is based on telegraf plugin name.
|
|
func (d *DiskIO) PluginName() string {
|
|
return "diskio"
|
|
}
|
|
|
|
// UnmarshalTOML decodes the parsed data to the object
|
|
func (d *DiskIO) UnmarshalTOML(data interface{}) error {
|
|
return nil
|
|
}
|
|
|
|
// TOML encodes to toml string.
|
|
func (d *DiskIO) TOML() string {
|
|
return fmt.Sprintf(`[[inputs.%s]]
|
|
## By default, telegraf will gather stats for all devices including
|
|
## disk partitions.
|
|
## Setting devices will restrict the stats to the specified devices.
|
|
# devices = ["sda", "sdb", "vd*"]
|
|
## Uncomment the following line if you need disk serial numbers.
|
|
# skip_serial_number = false
|
|
#
|
|
## On systems which support it, device metadata can be added in the form of
|
|
## tags.
|
|
## Currently only Linux is supported via udev properties. You can view
|
|
## available properties for a device by running:
|
|
## 'udevadm info -q property -n /dev/sda'
|
|
## Note: Most, but not all, udev properties can be accessed this way. Properties
|
|
## that are currently inaccessible include DEVTYPE, DEVNAME, and DEVPATH.
|
|
# device_tags = ["ID_FS_TYPE", "ID_FS_USAGE"]
|
|
#
|
|
## Using the same metadata source as device_tags, you can also customize the
|
|
## name of the device via templates.
|
|
## The 'name_templates' parameter is a list of templates to try and apply to
|
|
## the device. The template may contain variables in the form of '$PROPERTY' or
|
|
## '${PROPERTY}'. The first template which does not contain any variables not
|
|
## present for the device is used as the device name tag.
|
|
## The typical use case is for LVM volumes, to get the VG/LV name instead of
|
|
## the near-meaningless DM-0 name.
|
|
# name_templates = ["$ID_FS_LABEL","$DM_VG_NAME/$DM_LV_NAME"]
|
|
`, d.PluginName())
|
|
}
|