telegraf/plugins/inputs/dmcache/dmcache.go

33 lines
651 B
Go
Raw Normal View History

//go:generate ../../../tools/readme_config_includer/generator
2017-04-08 06:39:43 +08:00
package dmcache
import (
_ "embed"
2017-04-08 06:39:43 +08:00
"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/plugins/inputs"
)
2022-05-27 21:13:47 +08:00
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
2022-09-09 02:49:36 +08:00
//
//go:embed sample.conf
var sampleConfig string
2017-04-08 06:39:43 +08:00
type DMCache struct {
PerDevice bool `toml:"per_device"`
getCurrentStatus func() ([]string, error)
}
func (*DMCache) SampleConfig() string {
return sampleConfig
}
2017-04-08 06:39:43 +08:00
func init() {
inputs.Add("dmcache", func() telegraf.Input {
return &DMCache{
PerDevice: true,
getCurrentStatus: dmSetupStatus,
}
})
}