Oliver Dimes Blog

A programming blog containing some technical information but lots of ramblings about lots of different things!

A LibreHardwareMonitorCLI Tool

When I was doing some research into ways of getting hardware info out of Windows and into a time series database.

My first instinct is to use some such as HWInfo ( https://www.hwinfo.com/download/ ) which is a commerical program that you have probably seen people use in all kinds of settings (especially if you watch a lot of PC gaming adjacent youtube). It’s a swiss army knife of diagnostics, especially with the ase of use and the ability to dump logs into a .csv file is killer.

However, what I noticed is that the CLI version of this program requires a license which is something which for a business is fine, especially if you have a squad of hardware engineers but for homelabers and for personal use, I think is a little expensive.

So I decided to see if I could find some alternatives that were free and potenially open source, and I found a tool called OpenHardwareMonitor ( https://github.com/openhardwaremonitor/openhardwaremonitor ) which had a neat little CLI version called OpenHardwareMonitorReport which allowed you to call it and get all the system info. This cmd output could then be wrapped in anything, even if you are cursed enough to use Powershell!

However, Openhardwaremonitor has been a public archive since 2020 and the last update it got was to add AMD Zen 3 support, and what I’ve found is that both newer Intel and AMD systems struggle to get all their info dumped into this tool which lead me to look into alternatives. Also OpenHardwareMonitorReport appears to be gone as far as I can tell which isn’t great (was going to include a link in this article but couldn’t find it lol)

And this is where I land on LibreHardwareMonitor ( https://github.com/LibreHardwareMonitor/LibreHardwareMonitor), a fork of OpenHardwareMonitor that continues upon the work of the team which is more up to date and can handle much newer stuff. Only problem is that I couldn’t find a LibreHardwareMonitorReport alternative that did the things I needed to do.

Hence I decided to write this little Python class that effectively does all the work of OpenHardwareMonitorReport but in one python module. Can be found here : https://github.com/effeect/LibreHardwareMonitorCLI.

Currently, I’ve created a simple main.py script that simply outputs to a CLI, ready to be used in the CLI. I’m wanting to create some additions such as InfluxDB integration and stuff but I’m very happy with this :

There are still a few things that I want to do with this program :

  • Add some config options
  • Add some options to output to time series databases like InfluxDB

Many thanks, Ollie

Posted in

Leave a comment