Clarify platform support for temp input (#4756)

This commit is contained in:
Daniel Nelson
2018-09-26 19:05:55 -07:00
committed by GitHub
parent 74e9d1f078
commit 38e5e103ce
2 changed files with 17 additions and 16 deletions

View File

@@ -2,6 +2,7 @@ package temp
import (
"fmt"
"strings"
"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/plugins/inputs"
@@ -25,6 +26,9 @@ func (t *Temperature) SampleConfig() string {
func (t *Temperature) Gather(acc telegraf.Accumulator) error {
temps, err := t.ps.Temperature()
if err != nil {
if strings.Contains(err.Error(), "not implemented yet") {
return fmt.Errorf("plugin is not supported on this platform: %v", err)
}
return fmt.Errorf("error getting temperatures info: %s", err)
}
for _, temp := range temps {