windows_exporter icon indicating copy to clipboard operation
windows_exporter copied to clipboard

feat(collectors): Add Open-Hardware Monitor collector

Open zalgonoise opened this issue 1 year ago • 2 comments

Hi, this PR adds a collector for a running Open-Hardware Monitor service.

The idea of bringing this to windows_exporter spawned in #816 where the thermalzone collector was raising issues. Personally, I also tried to explore what could I collect using Windows WMI and CMI but to no success -- also being the first time exploring these Windows APIs (they are not pretty, in Go).

Since that didn't work out and someone had suggested a plan-B using Open-Hardware Monitor, that exposes its metrics via WMI, so that is what I went for with this PR.

It works perfectly well after a few weeks of usage, and I wanted to share it with the rest of the Prometheus community as well. Any feedback is appreciated.

image

zalgonoise avatar Aug 11 '24 16:08 zalgonoise

Hey @zalgonoise

thanks for your PR.

I saw you try-hard invoke WMI on your own. That must be painfull. I recommend to take a look at the printer collector where the bultin capabilites of the exporter are used to invoke wmi.

Outside of the exporter, take a look at https://github.com/microsoft/wmi

Even Microsoft provide bindings for WMI.

jkroepke avatar Aug 11 '24 17:08 jkroepke

thanks, @jkroepke 😄

You're right, I eventually ended up trying the WMI calls through powershell (also a first time for that, since I rarely use Windows) so I was trying to reproduce the same calls in Go, without the proper context of how to do it properly.

I will set this PR in draft while I check your references and update my branch, then publish it again for a new review 😄 thanks a lot for your insight!!

zalgonoise avatar Aug 11 '24 21:08 zalgonoise

@zalgonoise I ask myself, it's its an good idea to introduce a collector for an program which does not get maintenance anymore: https://github.com/openhardwaremonitor/openhardwaremonitor

jkroepke avatar Sep 08 '24 11:09 jkroepke

you know about https://github.com/nickbabcock/OhmGraphite ?

it's exporting to prometheus as well and makes use of librehardwaremonitor (ohm follow up)

swiffer avatar Sep 16 '24 14:09 swiffer

Good to know that https://github.com/LibreHardwareMonitor/LibreHardwareMonitor is the successor.

If an exporter already exists, we may not have to develop a own one.

jkroepke avatar Sep 16 '24 16:09 jkroepke

Closed in favor of https://github.com/nickbabcock/OhmGraphite

jkroepke avatar Oct 12 '24 16:10 jkroepke