move plugin interfaces into separate package
This commit is contained in:
@@ -11,7 +11,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/influxdata/telegraf"
|
||||
"github.com/influxdata/telegraf/plugins"
|
||||
"github.com/influxdata/telegraf/internal"
|
||||
"github.com/influxdata/telegraf/plugins/inputs"
|
||||
)
|
||||
@@ -39,7 +39,7 @@ func (*Sensors) SampleConfig() string {
|
||||
|
||||
}
|
||||
|
||||
func (s *Sensors) Gather(acc telegraf.Accumulator) error {
|
||||
func (s *Sensors) Gather(acc plugins.Accumulator) error {
|
||||
if len(s.path) == 0 {
|
||||
return errors.New("sensors not found: verify that lm-sensors package is installed and that sensors is in your PATH")
|
||||
}
|
||||
@@ -49,8 +49,8 @@ func (s *Sensors) Gather(acc telegraf.Accumulator) error {
|
||||
|
||||
// parse forks the command:
|
||||
// sensors -u -A
|
||||
// and parses the output to add it to the telegraf.Accumulator.
|
||||
func (s *Sensors) parse(acc telegraf.Accumulator) error {
|
||||
// and parses the output to add it to the plugins.Accumulator.
|
||||
func (s *Sensors) parse(acc plugins.Accumulator) error {
|
||||
tags := map[string]string{}
|
||||
fields := map[string]interface{}{}
|
||||
chip := ""
|
||||
@@ -107,7 +107,7 @@ func init() {
|
||||
if len(path) > 0 {
|
||||
s.path = path
|
||||
}
|
||||
inputs.Add("sensors", func() telegraf.Input {
|
||||
inputs.Add("sensors", func() plugins.Input {
|
||||
return &s
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user