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

Extend temperature sensors to distinguish devices #1747

Open
kkartaltepe opened this issue Nov 19, 2024 · 0 comments
Open

Extend temperature sensors to distinguish devices #1747

kkartaltepe opened this issue Nov 19, 2024 · 0 comments

Comments

@kkartaltepe
Copy link

kkartaltepe commented Nov 19, 2024

Is your feature request related to a problem? Please describe.
The current output of sensors might be

[
{"sensorKey":"nvme_composite","temperature":18.85,"sensorHigh":76.85,"sensorCritical":78.85}
{"sensorKey":"nvme_composite","temperature":20.79,"sensorHigh":76.85,"sensorCritical":78.85}
{"sensorKey":"spd5118","temperature":30.25,"sensorHigh":55,"sensorCritical":85} 
{"sensorKey":"spd5118","temperature":26.25,"sensorHigh":55,"sensorCritical":85}
]

In this case there is no way to distinguish the sensors for each DIMM or to distinguish the two nvme devices.

Describe the solution you'd like
Some kind of device identifier can be passed similar to the output of sensors in this case.

spd5118-i2c-16-51
Adapter: SMBus PIIX4 adapter port 0 at 0b00
temp1:        +26.2°C  (low  =  +0.0°C, high = +55.0°C)
                       (crit low =  +0.0°C, crit = +85.0°C)

spd5118-i2c-16-50
Adapter: SMBus PIIX4 adapter port 0 at 0b00
temp1:        +30.0°C  (low  =  +0.0°C, high = +55.0°C)
                       (crit low =  +0.0°C, crit = +85.0°C)

nvme-pci-0300
Adapter: PCI adapter
Composite:    +18.9°C  (low  =  -0.1°C, high = +76.8°C)
                       (crit = +78.8°C)

nvme-pci-0400
Adapter: PCI adapter
Composite:    +20.79°C  (low  =  -0.1°C, high = +76.8°C)
                       (crit = +78.8°C)

In this case the device bus (i2c/pci) and address (16-51,0300) are used to create distinct names. This is generally pretty nice, but im not sure what the precise scheme they use is. Generally this is fine though for things like nvme it would be nice to report the device (nvme0) instead of just the subsystem (nvme) + pci address (0300) but these seem kind of rare or require recent kernels as I dont see this except on one machine.

Describe alternatives you've considered

Do nothing and cry as temperature data gets mixed up downstream of psutil.

Additional context

Im happy to contribute something like the subsystem+address scheme into the struct if it sounds reasonable or just slamming them into an opaque device string to be more cross platform. Probably need more devices to test on than just what I have lying around though.

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