Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

temperatures - missing hwmon differences #1696

Open
Tulux opened this issue Aug 22, 2024 · 0 comments
Open

temperatures - missing hwmon differences #1696

Tulux opened this issue Aug 22, 2024 · 0 comments

Comments

@Tulux
Copy link

Tulux commented Aug 22, 2024

Hello,

On Linux, temperatures are collected by browsing /sys/class/hwmon/hwmon*/ but multiple hwmon may have same sensor name, ie :

> temp,host=lunatik,sensor=nvme_sensor_2 temp=73.85 1724328377000000000
> temp,host=lunatik,sensor=nvme_composite temp=39.85 1724328377000000000
> temp,host=lunatik,sensor=amdgpu_edge temp=43 1724328377000000000
> temp,host=lunatik,sensor=k10temp_tctl temp=53.875 1724328377000000000
> temp,host=lunatik,sensor=k10temp_tccd1 temp=47.875 1724328377000000000

-> 1st and 3rd lines have similar sensor tag values.

The issue comes from https://github.com/shirou/gopsutil/blob/master/sensors/sensors_linux.go#L94-L123 where SensorKey is composed of /sys/class/hwmon/hwmon*/name + _ + /sys/class/hwmon/hwmon*/temp_input :

name = name + "_" + label
which is not sufficient to discriminate similar devices such as nvme drives, HDDs, GPUs.

A solution would be adding hwmon number such as nameX_label (ie: nvme0_composite, nvme1_composite) although I am not sure whether the hwmon enumeration order is guaranteed, or prefix with vendor/device IDs however this might be more complicated since driver filesystem interfaces may differ.

Thank you

Florent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant