3. Accessing Data for Electric Power, Temperature, and Processor Utilization
Express5800/E120f-M Maintenance Guide
158
Chapter 3 Appendix
•
Execution example
C:
\
VBS> cscript //nologo Power.vbs
•
Execution result
Completion Code = 0x0
Power Consumption = 306 watts
The power consumption is 306 watts.
Tips
Power consumption readings may not be acquired depending on the power supply
units of the server. The completion code in such cases is
0xC1
or
0xCB
.
3.1.2
Intake air temperature
Execute the following standard IPMI commands to get air temperature data from Sensor Data Record (SDR) of
temperature sensors.
•
Get SDR Repository Info
•
Reserve SDR Repository
•
Get SDR
•
Get Sensor Reading
Here is the sample file created by using Visual Basic Script.
'Start Script
Option Explicit
' Prepare for MS IPMI Driver
Dim osvc, oclass
Dim oinstance, oipmi
set osvc = getobject("winmgmts:root
\
wmi")
set oclass = osvc.get("microsoft_ipmi")
for each oinstance in osvc.instancesof("microsoft_ipmi")
set oipmi = oinstance
next
' (Get SDR Repository Info)
Dim oinparams
set oinparams = oclass.methods_("requestresponse").inparameters
' (Get SDR Repository Info)
oinparams.networkfunction = &ha
oinparams.lun = 0
oinparams.responderaddress = &h20
oinparams.command = &h20
oinparams.requestdatasize = 0
' Fire IPMI Command
Dim outparams
Dim i, RecordCount
set outparams = oipmi.execmethod_("requestresponse",oinparams)
RecordCount = outparams.ResponseData(3)*256 + outparams.ResponseData(2)
' (Reserve SDR Repository)
oinparams.networkfunction = &ha
oinparams.lun = 0
oinparams.responderaddress = &h20
oinparams.command = &h22
oinparams.requestdatasize = 0
Dim Reserve_LS, Reserve_MS
set outparams = oipmi.execmethod_("requestresponse",oinparams)
Reserve_LS = outparams.ResponseData(1)
Reserve_MS = outparams.ResponseData(2)
' (Get SDR) for each record
Dim Record_LS,Record_MS, Offset, Length
Dim cnt, sensorNum, sensorType
' First Record
Record_LS = 0
Record_MS = 0
For cnt = 0 to RecordCount-1
Offset = 0
Length = 9
oinparams.networkfunction = &ha
oinparams.lun = 0