Windows Temperature Monitoring Solution

Started by glenns, May 07, 2015, 05:03:45 PM

Previous topic - Next topic

glenns

Hi Guys,

I thought some of you might find this useful, I've been working on a method to get temperature monitoring on our windows machines and this is working really well.

First you'll need to install Open Hardware Monitor on the machine you wish to monitor.
(http://openhardwaremonitor.org/downloads/)
Once installed this will collect temperature, voltage, fan speed etc (depending on your hardware sensors) and make all this information available via WMI  :)

You will need the WMI Subagent in your agent config: SubAgent = wmi.nsm

You will then need to create some DCI's to collect the information, for example:
WMI.Query(root\OpenHardwareMonitor,SELECT * FROM Sensor WHERE Instanceid=3849, Value)



The value of InstanceID can be found using another tool, WMI Explorer. (https://wmie.codeplex.com/)

With WMI Explorer connect to the machine running Open Hardware Monitor, goto the root\OpenHardwareMonitor namespace, select the Sensor class and find the instance value of the Monitor you wish to collect information on.



I have been trying to make some WMI queries that will work from templates.  By using a more complex SQL query to filter the results without having to lookup the InstanceID, I've had some success with the following example.

WMI.Query(root\OpenHardwareMonitor,SELECT * FROM Sensor WHERE Name LIKE "'%CPU%'" AND SensorType="'Temperature'" AND Index=0 , Value)

Hope you find this useful,

Benjamin Dill

#1
I've used this solution in past and it works very well.
Actually I've added an ExternalList, so the available sensors can be discovered by instance discovery.




Line in Agent config file:
ExternalList = OpenHardwareMonitor.Sensors:powershell -NonInteractive -Command "& { get-wmiobject -namespace root\OpenHardwareMonitor -query 'select * from Sensor' | foreach { $$_.InstanceId } }"



WMI.Query(root\OpenHardwareMonitor,"select * from Sensor where InstanceId='{instance}'",Value)



SensorType = AgentReadParameter($node, "WMI.Query(root\OpenHardwareMonitor,\"select * from Sensor where InstanceId='" . $1 . "'\",SensorType)");
Name = AgentReadParameter($node, "WMI.Query(root\OpenHardwareMonitor,\"select * from Sensor where InstanceId='" . $1 . "'\",Name)");
Identifier = AgentReadParameter($node, "WMI.Query(root\OpenHardwareMonitor,\"select * from Sensor where InstanceId='" . $1 . "'\",Identifier)");

return %(SensorType == "Temperature", $1, Name . "  [" . Identifier . "]");