2022-05-24 21:49:47 +08:00
|
|
|
//go:generate ../../../tools/readme_config_includer/generator
|
2015-11-03 23:53:09 +08:00
|
|
|
package zfs
|
|
|
|
|
|
2020-11-28 02:58:32 +08:00
|
|
|
import (
|
2022-05-24 21:49:47 +08:00
|
|
|
_ "embed"
|
|
|
|
|
|
2020-11-28 02:58:32 +08:00
|
|
|
"github.com/influxdata/telegraf"
|
|
|
|
|
)
|
|
|
|
|
|
2022-05-24 21:49:47 +08:00
|
|
|
//go:embed sample.conf
|
|
|
|
|
var sampleConfig string
|
|
|
|
|
|
2016-06-01 00:49:56 +08:00
|
|
|
type Sysctl func(metric string) ([]string, error)
|
|
|
|
|
type Zpool func() ([]string, error)
|
2020-11-28 02:58:32 +08:00
|
|
|
type Zdataset func(properties []string) ([]string, error)
|
2023-10-26 05:21:06 +08:00
|
|
|
type Uname func() (string, error)
|
2015-11-03 23:53:09 +08:00
|
|
|
|
|
|
|
|
type Zfs struct {
|
2020-11-28 02:58:32 +08:00
|
|
|
KstatPath string
|
|
|
|
|
KstatMetrics []string
|
|
|
|
|
PoolMetrics bool
|
|
|
|
|
DatasetMetrics bool
|
|
|
|
|
Log telegraf.Logger `toml:"-"`
|
2023-10-26 05:21:06 +08:00
|
|
|
|
|
|
|
|
sysctl Sysctl //nolint:unused // False positive - this var is used for non-default build tag: freebsd
|
|
|
|
|
zpool Zpool //nolint:unused // False positive - this var is used for non-default build tag: freebsd
|
|
|
|
|
zdataset Zdataset //nolint:unused // False positive - this var is used for non-default build tag: freebsd
|
|
|
|
|
uname Uname //nolint:unused // False positive - this var is used for non-default build tag: freebsd
|
|
|
|
|
version int64 //nolint:unused // False positive - this var is used for non-default build tag: freebsd
|
2015-12-11 02:38:47 +08:00
|
|
|
}
|
2022-05-24 21:49:47 +08:00
|
|
|
|
|
|
|
|
func (*Zfs) SampleConfig() string {
|
|
|
|
|
return sampleConfig
|
|
|
|
|
}
|