NetXMS Support Forum

Please login or register.

Login with username, password and session length

Author Topic: Windows Temperature Monitoring Solution  (Read 9996 times)

glenns

  • Newbie
  • *
  • Posts: 4
    • View Profile
Windows Temperature Monitoring Solution
« on: May 07, 2015, 05:03:45 pm »

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:
Code: [Select]
SubAgent = wmi.nsm

You will then need to create some DCI's to collect the information, for example:
Code: [Select]
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.

Code: [Select]
WMI.Query(root\OpenHardwareMonitor,SELECT * FROM Sensor WHERE Name LIKE "'%CPU%'" AND SensorType="'Temperature'" AND Index=0 , Value)
Hope you find this useful,
Logged

Benjamin Dill

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: Windows Temperature Monitoring Solution
« Reply #1 on: August 13, 2015, 01:33:09 pm »

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:
Code: [Select]
ExternalList = OpenHardwareMonitor.Sensors:powershell -NonInteractive -Command "& { get-wmiobject -namespace root\OpenHardwareMonitor -query 'select * from Sensor' | foreach { $$_.InstanceId } }"


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


Code: [Select]
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 . "]");
« Last Edit: August 13, 2015, 01:38:14 pm by Benjamin Dill »
Logged