CPU Temperature Monitor

Updated 12/18/2006 - fixed issue with not listening for Microsoft.Win32.SystemEvents.SessionEnded event - can't logoff/shutdown issue

Updated 11/24/2006 - added check if system implements the required WMI objects.

Updated 11/30/2006 - fixed GDI memory leak

Given the issues with Toshiba laptops running very hot with Vista Glass Aero enabled, and just in general with XP as well ( Hot enough to burnout motherboards that require replacements from the manufacturer)  I wrote this utility to give me system tray status on the current CPU temperature.  I'm currently adding GPU temperature but that requires distribution of licensed components (dynamic libraries).

Installation Files - a self extracting Exe file that contains the MSI installer - built with WinRar.

Solution Files - only contains projects with no private certificates - you'll need to change some things to get it working.

Basically, it just sits in your system tray showing the current CPU temperature with the following color schemes:

  • Green - Running at below 50% of critical temperature
  • Yellow - Running at > 50% but < 75% of critical temperature
  • Red - Running >= 75% of critical temperature.

TemperatureMonitor1

These settings are configurable if you modify the TemperatureMonitor.exe.config file, along with the maximum readings.

The first reading shown is the current CPU temperature; the second is the Critical Temperature as reported by WMI. 

The WMI namespace and object is root\WMIMSAcpi_ThermalZoneTemperature

WMI unfortunately requires elevated permissions on Vista.

The task bar icon has 2 menu options;

  • Restore - restores the window as shown below
  • Exits the application

The main window is show below:

TemperatureMonitor

  • The first tab just shows a Line Plot of the history of readings
  • Second tab is a list of those readings
  • Third tab is used for diagnostics and has a list of any exceptions.  There's also a file written to the application directory but it only has the last exception
  • The last tab is the about box that also has the "Install Public Certification" action button on it.

The assembly is signed with my sample signing certificate.  If you click on the about box you can install the public certificate but it still requires user action to launch in Vista given UAC restrictions and Windows Defender doesn't recognize the program.

Use at your own risk!!!

Some users are reporting issues.  This is dependant upon specific WMI obects being present and implemented on your system.

To Test, put the following into a VBS file, then run the following script from an elevated command prompt as follows:
cscript CpuTemp.vbs
============
''''On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\WMI")
Set colItems = objWMIService.ExecQuery( _
"SELECT * FROM MSAcpi_ThermalZoneTemperature",,48)
For Each objItem in colItems
Wscript.Echo "-----------------------------------"
Wscript.Echo "MSAcpi_ThermalZoneTemperature instance"
Wscript.Echo "-----------------------------------"
Wscript.Echo "CurrentTemperature: " & objItem.CurrentTemperature
Wscript.Echo "CurrentTemperature: " & objItem.CriticalTripPoint
Wscript.Echo "CurrentTemperature: " & objItem.ThermalStamp
Next

This article is part of the GWB Archives. Original Author: Shawn Cicoria

New on Geeks with Blogs

  • We Won The One Award I Actually Care About

    Full Scale made the Inc. 5000 for the fifth year straight, the 12th listing across my three companies. Here is why the one award you cannot buy is worth stopping for.

  • Your Customers Build the Features Now

    I let a tool I liked sit dead for a year rather than build the features I wanted. An MCP server meant I never had to, and your customers can do the same to your product.

  • Get the Size of a Directory in Linux the Easy Way

    du -sh for the quick answer, ncdu for the cleanup, df for the disk itself: every command for checking directory size in Linux, plus why du and df never agree.

  • Vim Search and Replace: The Ultimate Guide

    One :%s command replaces every match in a file before a find dialog would even open. The Vim substitute patterns worth the muscle memory: flags, ranges, capture groups, and multi-file edits.