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

feat(collectors): Add Open-Hardware Monitor collector #1564

Conversation

zalgonoise
Copy link

@zalgonoise zalgonoise commented Aug 11, 2024

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 zalgonoise requested a review from a team as a code owner August 11, 2024 16:47
@zalgonoise zalgonoise force-pushed the feature/816/add-ohwm-collector branch 3 times, most recently from 3b39b2b to f306103 Compare August 11, 2024 17:00
@zalgonoise zalgonoise force-pushed the feature/816/add-ohwm-collector branch from f306103 to 3dad99e Compare August 11, 2024 17:13
@jkroepke
Copy link
Member

jkroepke commented Aug 11, 2024

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.

@zalgonoise
Copy link
Author

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 zalgonoise marked this pull request as draft August 11, 2024 21:03
@@ -0,0 +1,35 @@
# ohwm collector
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# ohwm collector
# open_hardware_monitor collector

Just name it like that. By full name. People may better understand what it does and people google for it, they may find this. No one knows what ohwm could be unless they read the docs.

It would be great to have some small docs about how I can install the Open Hardware Monitor

@jkroepke
Copy link
Member

jkroepke commented Sep 8, 2024

@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

@swiffer
Copy link

swiffer commented Sep 16, 2024

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

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

@jkroepke
Copy link
Member

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
Copy link
Member

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

@jkroepke jkroepke closed this Oct 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants