how to retrieve CPU temperature on Server 2008 machine

The following code works great on our HP server running Server 2003, but won't return any temperature values on our Dell running Server 2008.  Any suggestions on how to make it work on 2008?


On Error Resume Next
Dim strComputer, Ktemp, Ctemp, CPUTemp
strComputer = "."


Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Processor")



Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\WMI")
Set colItems = objWMIService.ExecQuery("Select * from  MSAcpi_ThermalZoneTemperature")
For Each objItem in colItems

With objItem
 WScript.Echo "Active: " & .Active & vbcrlf
 wscript.echo "current: " & .currenttemperature & vbcrlf
 
 FarTemp = ((9/5)*((.CurrentTemperature - 2732)/10)) + 32
 CelTemp = ((FarTemp - 32) * (5/9))
 WScript.Echo "Current Temperature: " & vbcrlf & _
                                     FarTemp & " (Degrees Farenheit)" & _
                                     " | " & CelTemp & " (Degrees Celcius)" & vbcrlf
 
 FarTemp=((9/5)*((.CriticalTripPoint - 2732)/10)) + 32
 CelTemp = ((FarTemp - 32) * (5/9))
 WScript.Echo "Critical Temperature (Temperature at which the OS must shutdown the system): " & vbcrlf & _
                                     FarTemp & " Degrees Farenheit" & _
                                     " | " & CelTemp & " Degrees Celcius" & vbcrlf
                                     
  If .PassiveTripPoint <> 0 Then                                
  FarTemp=((9/5)*((.PassiveTripPoint - 2732)/10)) + 32
  CelTemp = ((FarTemp - 32) * (5/9))
  WScript.Echo "Passive Temperature (Temperature at which the OS must activate CPU throttling): " & vbcrlf & _
                                     FarTemp & " Degrees Farenheit" & _
                                     vbcrlf & CelTemp & " Degrees Celcius" & vbcrlf
  End If
 
 WScript.Echo "Thermal Stamp: " & .ThermalStamp & vbcrlf
End With
Next
LVL 1
BradleyClevelandAsked:
Who is Participating?
 
storminteractiveCommented:
Not sure what server you have but for most Dell's OMSA package would provide you with some possibilities of reading system sensors from command line (which you obviously then read through VBS).

Kind regards,
Paul
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.