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

[OpenBSD] Add support for sensors_temperatures #1960

Open
TheQue42 opened this issue Jun 12, 2021 · 2 comments
Open

[OpenBSD] Add support for sensors_temperatures #1960

TheQue42 opened this issue Jun 12, 2021 · 2 comments

Comments

@TheQue42
Copy link

Summary

  • OS: OpenBSD
  • Type new-api

Description

Currently, in psutil 5.8 on openbsd 6.8, the sensors_temperatures returns:

AttributeError: module 'psutil' has no attribute 'sensors_temperatures'

The values are available (providing the system runs the sensorsd) at:

#> sysctl hw.sensors
hw.sensors.cpu0.temp0=43.00 degC
hw.sensors.acpitz0.temp0=27.80 degC (zone temperature)
hw.sensors.acpitz1.temp0=29.80 degC (zone temperature)
hw.sensors.pchtemp0.temp0=39.00 degC

It would be really good if this api call could be supported on openbsd.

@giampaolo
Copy link
Owner

Probably because I'm running a virtualized OpenBSD via Vagrant, I only have access to these:

openbsd64$ sysctl hw.sensors
hw.sensors.acpibat0.volt0=10.00 VDC (voltage)
hw.sensors.acpibat0.volt1=10.00 VDC (current voltage)
hw.sensors.acpibat0.power0=0.00 W (rate)
hw.sensors.acpibat0.watthour0=50.00 Wh (last full capacity)
hw.sensors.acpibat0.watthour1=0.10 Wh (warning capacity)
hw.sensors.acpibat0.watthour2=0.05 Wh (low capacity)
hw.sensors.acpibat0.watthour3=49.50 Wh (remaining capacity), OK
hw.sensors.acpibat0.watthour4=50.00 Wh (design capacity)
hw.sensors.acpibat0.raw0=0 (battery idle), OK
hw.sensors.acpiac0.indicator0=On (power supply)

If you know how to do it feel free to make a PR though.

@giampaolo
Copy link
Owner

Example of OpenBSD implementation:
https://github.com/brndnmtthws/conky/blob/23a493683532e9ff5fd1756fd6e46322dec54216/src/openbsd.cc#L430-L483

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

No branches or pull requests

2 participants