none
Object Model: Getting Hardware Information RRS feed

  • Question

  • Is there an easy way to get information about the hardware on a specific machine - like the mac address or guid of the Ethernet adapter?

    In our setups, we have multiple OS images on each machine - and each image has a different name.

    Most of the scripts involving machines - moving a machine between pools, deleting a machine - use this name. To make sure that we have the right machine, we'd like to institute a search through machines on the controller, and compare something in the hardware - (eg. the Ethernet's MAC Address)- to verify that we have the correct machine. It looks like the Parameter list returned by Machine.GetParameters() doesn't have something like that..

    Saturday, October 20, 2012 3:39 AM

Answers

  • There are a couple of ways to get information from the machine -

    1. You can query the properties of a machine. This will probably NOT get you the mac address but does provide some basic machine and testing information like OS platform. This is done via Machine::GetMachineProperties()

    2. If you want specific information from a specific device, then you would need to query the devices gatherer information. This can be had from ITargetInformation::XmlData property. Then you would need to query the xmldata for the appropriate property. A sample network xpath might be //devnode/networkadapter/macadress.


    John -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Monday, October 22, 2012 5:17 PM

All replies

  • There are a couple of ways to get information from the machine -

    1. You can query the properties of a machine. This will probably NOT get you the mac address but does provide some basic machine and testing information like OS platform. This is done via Machine::GetMachineProperties()

    2. If you want specific information from a specific device, then you would need to query the devices gatherer information. This can be had from ITargetInformation::XmlData property. Then you would need to query the xmldata for the appropriate property. A sample network xpath might be //devnode/networkadapter/macadress.


    John -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Monday, October 22, 2012 5:17 PM
  • Each test target has a lot of device/target specific information available to it via the target.XmlData property.

    to get information about the machine or system itself, you can find the system target that represents that machine, and use it to query for the types of data you are looking for.

      

     TargetData data = ProductInstance.FindTargetFromSystem(Machine);
       string xml = data.XmlData;
    

    Monday, October 22, 2012 10:16 PM