From 0373b9b8d687254404cc7c0c1a7ed429f302293f Mon Sep 17 00:00:00 2001 From: "Sean E. Russell" Date: Wed, 3 Feb 2021 15:24:56 -0600 Subject: [PATCH] Fixes #152, missing thermal device on FreeBSD reported as error, when it isn't. --- devices/temp_freebsd.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/devices/temp_freebsd.go b/devices/temp_freebsd.go index e87dcb3..593ae1e 100644 --- a/devices/temp_freebsd.go +++ b/devices/temp_freebsd.go @@ -63,11 +63,16 @@ func devs() []string { } for k, _ := range sensorOIDS { idx := strings.Index(string(bs), k) - if idx < 0 { - log.Printf(tr.Value("error.nodevfound", k)) - } else { + if idx >= 0 { rv = append(rv, k) } } + if len(rv) == 0 { + oids := make([]string, 0, len(sensorOIDS)) + for k, _ := range sensorOIDS { + oids = append(oids, k) + } + log.Printf(tr.Value("error.nodevfound", strings.Join(oids, ", "))) + } return rv }