Freigeben über


Working with the Microsoft_IPMI driver class to retrieve driver specific information Part 1

If a driver supports WMI, one can send specific commands to the driver to request information.   Below is a list of commands that are suported by the IPMI driver:

NetFn   Lun   Command

0A         00      10                Read FRU Data

06         00      38               Get Channel Authen. Cap. Command

0C        00       22              Get SOL Config. Parameters

0C        00      02               Get LAN Config. Parameters

0A        00       43               Get SEL Entry

 

In Part 1 of our discussion of sending commands to drivers, we will examine how to use a VBS script to execute a specific command.  In Part 2 we will discuss how to use the CIM Studio GUI tools to retrieve the same information.

 

Lets start with the VBS source code:

 

option explicit

dim osvc, oclass,oinstance, oipmi, oinparams, outparams

'

' open a WMI connection to the driver.

' by retrieving the instance of the driver from WMI.

'

set osvc = getobject("winmgmts:root\wmi")

set oclass = osvc.get("microsoft_ipmi")

'

' Point to a speicific instance of the class, in our case

' we have only one, so the loop stops after 1 iteration

'

for each oinstance in osvc.instancesof("microsoft_ipmi")

            set oipmi = oinstance

next

'

' Create a method object to be used to execute a specific method.

'in this case, we want the RequestResponse method to read driver specific

' information.

'

set oinparams = oclass.methods_("requestresponse").inparameters.spawninstance_

'

' Using the table provoded above, lets setup the structure to

' request information from the driver on a specific LUN with a specific command

' "Read FRU Data"

' At this point, you need to know specifc driver command information

' to complete the setup, you can retrieve this information from the driver documentation.

'

oinparams.networkfunction = 10

oinparams.lun = 0

oinparams.responderaddress = 32

oinparams.command = 17

oinparams.requestdatasize = 4

 

oinparams.requestdata = array(0, 0, 0, 1)

wscript.echo oinparams.getobjecttext_

'

' Execute the request

'

set outparams = oipmi.execmethod_("requestresponse",oinparams)

wscript.echo outparams.getobjecttext_

 

If you cut and past this code into notepad and save the file as a .VBS. The output from the script will look similiar to the following, provided you have the IPMI driver installed on your system:

 

D:\>cscript test.vbs

Microsoft (R) Windows Script Host Version 5.8

Copyright (C) Microsoft Corporation. All rights reserved.

instance of __PARAMETERS

{

Command = 17; //Hex 11h

Lun = 0;

NetworkFunction = 10;

RequestData = {0, 0, 0, 1};

RequestDataSize = 4;

ResponderAddress = 32;

};

instance of __PARAMETERS

{

CompletionCode = 0;

ResponseData = {0, 1, 1};

ResponseDataSize = 3;

};

In my next post, we will provide the steps for using the WM GUI Tools CIM Studio and WBEMTEST to execute the same command with the same parameters.

Comments

  • Anonymous
    August 01, 2013
    nigh impossible finding information along these lines, thank you for this, cannot locate your part of this, was published?