gopsutil icon indicating copy to clipboard operation
gopsutil copied to clipboard

Temperature on Windows

Open LeMoussel opened this issue 7 years ago • 9 comments

Hi,

On Windows (Intel CPU) host.SensorsTemperatures() return []

LeMoussel avatar Dec 18 '17 15:12 LeMoussel

It returns a common.ErrNotImplementedError too. Help to implement this on Windows with WMI or (preferably) win32 API very much appreciated 😉

Lomanic avatar Dec 19 '17 08:12 Lomanic

@LeMoussel @Lomanic , i already implement it.

I hope you can check it, and if any problem about it, welcome to tell me, i will fix it.

Thanks.

pytimer avatar Jul 09 '18 07:07 pytimer

For future reference, it might be doable to use Open Hardware Monitor (via this SO answer, by loading its DLL) so we don't rely on the slow and unreliable wmi requests implemented in #550. The only drawback is that gopsutil users have to include this DLL next to their binary if we go this path.

Lomanic avatar Jul 14 '18 16:07 Lomanic

But if we use Open Hardware Monitor to implement it, all user or application should include this DLL, does it increase the complexity of application deployment?

pytimer avatar Jul 15 '18 04:07 pytimer

Open Hardware Monitor API documentation is poor. For GPU you can see code in https://github.com/openhardwaremonitor/openhardwaremonitor/blob/master/Hardware/ATI/ATIGPU.cs https://github.com/openhardwaremonitor/openhardwaremonitor/blob/master/Hardware/Nvidia/NvidiaGPU.cs

LeMoussel avatar Jul 15 '18 07:07 LeMoussel

But if we use Open Hardware Monitor to implement it, all user or application should include this DLL, does it increase the complexity of application deployment?

Not necessarily if we use something like github.com/gobuffalo/packr/v2 which would embed the DLL in binaries. To be tested.

Lomanic avatar Dec 12 '18 18:12 Lomanic

It seems like this could complicate the build process especially when cross compiling. Also, I believe users of this library would need to provide the source code for Open Hardware Monitor when distributing their applications.

danielnelson avatar Dec 12 '18 23:12 danielnelson

Not necessarily if we use something like github.com/gobuffalo/packr/v2 which would embed the DLL in binaries. To be tested.

I saw this packr tool, it should use packr build when we want to embed the DLL in binaries. But it maybe hard when cross compiling if use this tools.

pytimer avatar Dec 14 '18 06:12 pytimer

As I see it, packr converts an asset to a .go source code file with the asset's contents serialized to a []byte variable. We could commit this (probably huge) file and gopsutil users would be able to easily (cross-)compile without the packr build step. I hope the binary size for Windows users using the host package will not explode (the DLL is just a few kB).

Lomanic avatar Dec 14 '18 10:12 Lomanic