3. Accessing Data for Electric Power, Temperature, and Processor Utilization
Express5800/R120g-1M, R120g-2M Maintenance Guide
168
Chapter 3 Appendix
•
Result
Completion Code = 0x0
Power Consumption = 306 watts
The power consumption is 306 watts.
Tips
If the power consumption readings cannot be read on the server depending on the
power supply unit, the completion code is
0xC1
or
0xCB
.
Intake air temperature
3.1.2
Run the following commands to search Sensor Data Record (SDR) for the temperature sensor and read intake
air temperature data.
•
Get SDR Repository Info
•
Reserve SDR Repository
•
Get SDR
•
Get Sensor Reading
Below is the sample file (named as Sensor.vbs) 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
oinparams.responderaddress = &h20
oinparams.command = &h23
oinparams.requestdata = array(Reserve_LS, Reserve_MS, Record_LS, Record_MS, Offset, Length)
oinparams.requestdatasize = 6
set outparams = oipmi.execmethod_("requestresponse",oinparams)
If outparams.Completioncode = 0 Then
If outparams.ResponseData(6) = 1 Then ' Full Sensor Record