Skip to content

Commit

Permalink
fix(inputs.temp): ignore warnings returned by gopsutil
Browse files Browse the repository at this point in the history
The temperature sensor reading can return warnings as an error.
Previously we ignored these, but they were removed from gopsutil. The
warning was returned to gopsutil and we should continue to ignore
warnings and only fail on a true error.

fixes: influxdata#12841
  • Loading branch information
powersj committed Mar 13, 2023
1 parent f104c1a commit c867ae9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion plugins/inputs/system/ps.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,14 @@ func (s *SystemPS) SwapStat() (*mem.SwapMemoryStat, error) {
}

func (s *SystemPS) Temperature() ([]host.TemperatureStat, error) {
return host.SensorsTemperatures()
temp, err := host.SensorsTemperatures()
if err != nil {
_, ok := err.(*host.Warnings)
if !ok {
return temp, err
}
}
return temp, nil
}

func (s *SystemPSDisk) Partitions(all bool) ([]disk.PartitionStat, error) {
Expand Down

0 comments on commit c867ae9

Please sign in to comment.