telegraf/plugins/inputs/zfs/zfs.go

36 lines
948 B
Go
Raw Permalink Normal View History

2015-11-03 15:53:09 +00:00
package zfs
type Sysctl func(metric string) ([]string, error)
type Zpool func() ([]string, error)
2015-11-03 15:53:09 +00:00
type Zfs struct {
KstatPath string
KstatMetrics []string
2015-12-08 09:50:42 +00:00
PoolMetrics bool
sysctl Sysctl
zpool Zpool
}
2015-11-03 15:53:09 +00:00
var sampleConfig = `
## ZFS kstat path. Ignored on FreeBSD
## If not specified, then default is:
# kstatPath = "/proc/spl/kstat/zfs"
## By default, telegraf gather all zfs stats
## If not specified, then default is:
# kstatMetrics = ["arcstats", "zfetchstats", "vdev_cache_stats"]
## For Linux, the default is:
# kstatMetrics = ["abdstats", "arcstats", "dnodestats", "dbufcachestats",
# "dmu_tx", "fm", "vdev_mirror_stats", "zfetchstats", "zil"]
## By default, don't gather zpool stats
# poolMetrics = false
2015-11-03 15:53:09 +00:00
`
func (z *Zfs) SampleConfig() string {
return sampleConfig
}
func (z *Zfs) Description() string {
return "Read metrics of ZFS from arcstats, zfetchstats, vdev_cache_stats, and pools"
2015-11-03 15:53:09 +00:00
}