Update sensors warning check

This commit is contained in:
Svilen Markov
2025-04-15 03:37:38 +01:00
parent 2c3e14d84c
commit 502950709c
2 changed files with 11 additions and 6 deletions

View File

@@ -201,11 +201,12 @@ func Collect(req *SystemInfoRequest) (*SystemInfo, []error) {
// currently disabled on Windows because it requires elevated privilidges, otherwise
// keeps returning a single sensor with key "ACPI\\ThermalZone\\TZ00_0" which
// doesn't seem to be the CPU sensor or correspond to anything useful when
// compared against the temperatures Libre Hardware Monitor reports
// also disabled on openbsd because it's not implemented by go-psutil
if runtime.GOOS != "windows" && runtime.GOOS != "openbsd" {
// compared against the temperatures Libre Hardware Monitor reports.
// Also disabled on the bsd's because it's not implemented by go-psutil for them
if runtime.GOOS != "windows" && runtime.GOOS != "openbsd" && runtime.GOOS != "netbsd" && runtime.GOOS != "freebsd" {
sensorReadings, err := sensors.SensorsTemperatures()
if sensorReadings != nil && len(sensorReadings) > 0 {
_, errIsWarning := err.(*sensors.Warnings)
if err == nil || errIsWarning {
if req.CPUTempSensor != "" {
for i := range sensorReadings {
if sensorReadings[i].SensorKey == req.CPUTempSensor {