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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.