Skip to content

Commit 7046bd3

Browse files
committed
Pull request #426: fix: MacOS crash by disabling sensors on MacOS
Merge in PRODUCT/glouton from fix-macos-crash to main * commit 'bd394303ff6a4d1c6b96ff7986d6a9cbf8f31ef8': fix: MacOS crash by disabling sensors on MacOS
2 parents 81fc46c + bd39430 commit 7046bd3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

inputs/temp/temp.go

+9
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,26 @@
1717
package temp
1818

1919
import (
20+
"errors"
21+
2022
"github.com/bleemeo/glouton/inputs"
2123
"github.com/bleemeo/glouton/inputs/internal"
2224
"github.com/bleemeo/glouton/prometheus/registry"
25+
"github.com/bleemeo/glouton/version"
2326

2427
"github.com/influxdata/telegraf"
2528
telegraf_inputs "github.com/influxdata/telegraf/plugins/inputs"
2629
"github.com/influxdata/telegraf/plugins/inputs/temp"
2730
)
2831

32+
var ErrUnsupportedSystem = errors.New("system is not supported")
33+
2934
// New returns a temperature input.
3035
func New() (telegraf.Input, registry.RegistrationOption, error) {
36+
if version.IsMacOS() {
37+
return nil, registry.RegistrationOption{}, ErrUnsupportedSystem
38+
}
39+
3140
input, ok := telegraf_inputs.Inputs["temp"]
3241
if !ok {
3342
return nil, registry.RegistrationOption{}, inputs.ErrDisabledInput

0 commit comments

Comments
 (0)