2022-05-24 21:49:47 +08:00
|
|
|
//go:generate ../../../tools/readme_config_includer/generator
|
2018-09-11 02:52:15 +08:00
|
|
|
package temp
|
|
|
|
|
|
|
|
|
|
import (
|
2022-05-24 21:49:47 +08:00
|
|
|
_ "embed"
|
2018-09-11 02:52:15 +08:00
|
|
|
|
|
|
|
|
"github.com/influxdata/telegraf"
|
|
|
|
|
"github.com/influxdata/telegraf/plugins/inputs"
|
|
|
|
|
)
|
|
|
|
|
|
2022-05-24 21:49:47 +08:00
|
|
|
//go:embed sample.conf
|
|
|
|
|
var sampleConfig string
|
|
|
|
|
|
2018-09-11 02:52:15 +08:00
|
|
|
type Temperature struct {
|
2024-01-18 22:56:47 +08:00
|
|
|
MetricFormat string `toml:"metric_format"`
|
|
|
|
|
DeviceTag bool `toml:"add_device_tag"`
|
|
|
|
|
Log telegraf.Logger `toml:"-"`
|
2018-09-11 02:52:15 +08:00
|
|
|
}
|
|
|
|
|
|
2022-05-24 21:49:47 +08:00
|
|
|
func (*Temperature) SampleConfig() string {
|
|
|
|
|
return sampleConfig
|
|
|
|
|
}
|
|
|
|
|
|
2018-09-11 02:52:15 +08:00
|
|
|
func init() {
|
|
|
|
|
inputs.Add("temp", func() telegraf.Input {
|
2024-01-18 22:56:47 +08:00
|
|
|
return &Temperature{}
|
2018-09-11 02:52:15 +08:00
|
|
|
})
|
|
|
|
|
}
|