LibreHardwareMonitor based drop-in replacement for OpenHardwareMonitorCLI (Windows agent, PawnIO instead of WinRing0)

Hi all,

since Open Hardware Monitor is dead and was removed from Checkmk because of its vulnerable WinRing0 driver (CVE-2020-14979), I built a drop-in replacement for OpenHardwareMonitorCLI.exe based on the actively developed LibreHardwareMonitor.

Repository and downloads: GitHub - Tinnitus97/Libre_Hardware_Monitor_checkmk · GitHub
(prebuilt files under Releases)

Related: the closed German thread LibreHardwareMonitor statt OpenHardwareMonitor, where simply swapping OHM for LHM did not work, and the idea Replace Open Hardware Monitor with LibreHardwareMonitor.

What it is

  • A headless WMI provider like the original CLI, built on the current LibreHardwareMonitorLib
  • Same two files (OpenHardwareMonitorCLI.exe + OpenHardwareMonitorLib.dll), so the existing bakery rule “OpenHardwareMonitor (Windows)” deploys it unchanged
  • Same WMI namespace and classes (root\OpenHardwareMonitor, Sensor/Hardware), so no changes to the agent or the check plugins
  • Uses the signed PawnIO driver instead of WinRing0

Why plain LibreHardwareMonitor doesn’t work with Checkmk, and what this fixes

  • LHM identifiers are mapped to the OHM ones (/nvme/0 → /hdd/0, /motherboard → /mainboard, …), so existing service names stay the same
  • Data values are converted to GB (current LHM reports bytes, the parser expects GB)
  • Life is published as Remaining Life, so openhardwaremonitor_smart works
  • Constant limit values that LHM reports as temperatures (NVMe warning/critical temperature, DIMM thermal limits) are not published. Otherwise they become permanently CRIT temperature services.
  • Unconnected fan headers only appear once they spin, like in OHM
  • NaN values are sent as 0. The agent formats NaN as -nan(ind), which crashes the parser and turns the whole section UNKNOWN.

Tested

  • Against the current Checkmk source: the Windows agent’s WMI query and process start, the bakery plugin, and all five check plugins (clock, temperature, fan, power, SMART), including Checkmk’s own unit tests
  • With real sensor data from a Ryzen system (NVMe + SATA SSDs, Nuvoton NCT6799D, DDR5): 64 services, no crashes, SMART/fans/power/clock OK
  • GitHub Actions builds on Windows and checks that sensors are returned for exactly the WMI query the agent uses

Requirements

  • Windows x64, .NET Framework 4.7.2+
  • PawnIO driver: winget install namazso.PawnIO (without it, CPU temperatures, mainboard and DIMM sensors are missing; disks, CPU load and memory still work)

Installation

  • Bakery: copy both files to local/share/check_mk/agents/windows/, enable the rule “OpenHardwareMonitor (Windows)”, bake and deploy
  • Without bakery: run install-checkmk.ps1 from the release as administrator, or copy both files to C:\ProgramData\checkmk\agent\bin and restart the agent service
  • Then run a service discovery

Test on a host with OpenHardwareMonitorCLI.exe --dump: it prints the sensors in the same format the agent sends.

Notes

  • Checkmk’s default temperature levels (CPU 60/70 °C, disks 40/50 °C) are too low for current hardware (Ryzen Tctl, NVMe). Adjust them with the “Temperature” rule.
  • By default the build uses the current LibreHardwareMonitor master; the NuGet release can be used instead (build.cmd -FromNuGet).

For the Checkmk team

You are very welcome to use this code, completely or in parts, to bring LibreHardwareMonitor support back into the agent officially. That is the goal of this project. It is MPL-2.0 (GPL-compatible), and I additionally allow Checkmk GmbH to use my code under the GPLv2 or any license used for Checkmk. Integration notes and two findings in the current check plugins (NaN handling in the parser, default temperature levels) are in the README under “For the Checkmk team”.

Feedback and test reports from other hardware (Intel, other mainboards/SuperIO chips, servers, GPUs) are very welcome!

2 Likes