Edit

Share via


OpenHardwareMonitor Class

Definition

This class connects to a running instance of OpenHardwareMonitor and reads out all available values. This works only if OpenHardwareMonitor (https://openhardwaremonitor.org/) is currently running. While the tool needs to be run with elevated permissions, the application using this binding does not.

public sealed class OpenHardwareMonitor : IDisposable
type OpenHardwareMonitor = class
    interface IDisposable
Public NotInheritable Class OpenHardwareMonitor
Implements IDisposable
Inheritance
OpenHardwareMonitor
Implements

Constructors

OpenHardwareMonitor()

Constructs a new instance of this class. The class can be constructed even if no sensors are available or OpenHardwareMonitor is not running (yet).

OpenHardwareMonitor(OpenHardwareMonitorTransport, String, Int32)

Constructs a new instance of this class using a specific transport protocol The class can be constructed even if no sensors are available or OpenHardwareMonitor is not running (yet).

Properties

LogicalProcessors

Number of logical processors in the system

MonitoringInterval

The minimum monitoring interval.

UpdateStrategy

Selects the sensor update strategy. Default is PerSensor for WMI, SynchronousAfterTimeout for HTTP.

Methods

DisableDerivedSensors()

Remove the derived sensors from the active list.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

EnableDerivedSensors(Area, TimeSpan)

Adds some special derived sensors.

  • For each power sensor, this adds another sensor that integrates power over time and so generated the energy used in W/h or more conveniently, Kilowatthours (this is the unit the electricity bill bases on)
  • Gives the heat flux for the primary CPU, using the given CPU die size (or a default value)
GetCpuLoad()

Gets the overall CPU Load

GetHardwareComponents()

Returns a list of hardware components, such as "CPU", "GPU" or "Mainboard"

GetSensorList()

Query the list of all available sensors.

GetSensorList(OpenHardwareMonitor+Hardware)

Get the list of sensors for a specific piece of hardware

StartMonitoring(OpenHardwareMonitor+Sensor, TimeSpan, OpenHardwareMonitor+OnNewValue)

Starts monitoring a sensor. This will internally start a thread that calls the provided action each time the TimeSpan elapses.

StopAllMonitoring()

Stops all monitoring.

StopMonitoring(OpenHardwareMonitor+MonitoringJob)

Stops monitoring of the given job.

TryGetAverage<T>(OpenHardwareMonitor+Hardware, T)

Tries to calculate the average of a set of sensors.

TryGetAverageCpuTemperature(Temperature)

Gets the average CPU temperature (averaged over all CPU sensors / cores)

TryGetAverageGpuTemperature(Temperature)

Gets the average GPU temperature (averaged over all GPU sensors / cores)

UpdateSensors(Boolean)

Re-reads the sensor tree. Updates all values and the list of sensors. You should invalidate all cached OpenHardwareMonitor.Sensor and OpenHardwareMonitor.Hardware instances after using this with refreshSensorList=true

Applies to