Taking an inventory of systems in your datacenter can be a first step to monitoring the status of the servers. You can store the inventory data for future use in monitoring configuration changes.

This example shows how to get the physical identifying information from the Implementation namespace by enumerating CIM_Chassis for the managed server. This approach is convenient when the namespace is known in advance. For information about getting physical identifying information by using the Interop namespace, see Report Manufacturer, Model, and Serial Number.

You might see more than one instance of CIM_Chassis if the managed server is a blade system. Locating Chassis Information in a Blade Server shows an example of a server with two instances of CIM_Chassis, one for a blade and the other for the blade enclosure.

Locating Chassis Information in a Blade Server

This pseudocode depends on the pseudocode in Make a Connection to the CIMOM, Identifying the Base Server Scoping Instance, and Mapping Integer Property Values to Strings.

To report Manufacturer, Model, and Serial Number by using only the Implementation namespace

1

Connect to the server URL.

Specify the Implementation namespace, supplied as a parameter, for the connection.

The actual namespace you will use depends on your installation.

use wbemlib
use sys
use connection renamed cnx
connection = Null

params = cnx.get_params()
if params is Null
   sys.exit(-1)
connection = cnx.connect_to_host( params )
if connection is Null
   print 'Failed to connect to: ' + params['host'] + ' as user: ' + params['user']
   sys.exit(-1)
2

Use the EnumerateInstances method to get all the CIM_Chassis instances on the server.

chassis_instance_names = connection.EnumerateInstanceNames( 'CIM_Chassis' )
if len( chassis_instance_names ) is 0
   print 'No %s instances were found.' % ('CIM_Chassis')
   sys.exit(0)
3

Print the Manufacturer, Model, and SerialNumber properties of the Chassis instances.

This example prints additional properties to help identify physical components.

use value_mapper renamed mapper

for instance_name in chassis_instance_names
   print_chassis( connection, instance_name )

function print_chassis( connection, instance_name )
   instance = connection.GetInstance( instance_name )

print '\n' + 'CIM_Chassis [' + instance.classname + '] ='

for property_name in [ 'ElementName', 'Tag', 'Manufacturer', \

     'Model', 'SerialNumber' ]
      if instance.key( property_name )
         value = instance[ property_name ]
      else
         value = '(not available)'
      print '  %30s : %s' % ( property_name, value )
   for property_name in [ ’PackageType’, 'ChassisPackageType' ]
      if instance.key( property_name )
         value = mapper.map_instance_property_to_string( connection,
                                                         instance,
                                                         property_name )
         if value is Null
            value = ’’
      else
         value = '(not available)'
      print '  %30s : %s' % ( property_name, value )

A sample of the output looks like the following:

CIM_Chassis [OMC_Chassis] =
                      ElementName : Chassis
                              Tag : 23.0
                     Manufacturer : Cirrostratus Systems
                            Model : 20KF6KM-02
                     SerialNumber : 67940851
                      PackageType : Blade
               ChassisPackageType : None

CIM_Chassis [OMC_Chassis] =
                      ElementName : Chassis
                              Tag : 23.1
                     Manufacturer : Cirrostratus Systems
                            Model : 20KF6KM-W
                     SerialNumber : 439-41902
                      PackageType : Chassis/Frame
               ChassisPackageType : Blade Enclosure