System administrators can query the BIOS
version of the managed server as part of routine maintenance.
This example shows how to get the BIOS version
string by traversing the
CIM_InstalledSoftwareIdentity
association from the server Scoping Instance. The VMware
implementation of the Software Inventory profile uses CIM_InstalledSoftwareIdentity
to associate firmware and hypervisor instances of
CIM_SoftwareIdentity
to the server Scoping Instance. VMware does not implement
the CIM_ElementSoftwareIdentity
association for firmware and hypervisor instances, so you
must use CIM_InstalledSoftwareIdentity
to locate the system BIOS instance of CIM_SoftwareIdentity.
Figure 1. Locating the BIOS Version from the Base Server Scoping
Instance
The VMware implementation of CIM_SoftwareIdentity
makes the version available in the VersionString
property rather than in the
MajorVersion
and MinorVersion
properties.
Specify the Interop namespace, supplied as a
parameter, for the connection.
use wbemlib
use sys
use connection renamed cnx
connection = Null
params = cnx.get_params()
if params is Null
sys.exit(-1)
interop_params = params
interop_params['namespace'] = 'root/interop'
connection = cnx.connect_to_host( interop_params )
if connection is Null
print 'Failed to connect to: ' + params['host'] + ' as user: ' + params['user']
sys.exit(-1)
Locate the Base Server Scoping Instance that
represents the managed server.
use scoping_instance renamed si
scoping_instance_name = si.get_scoping_instance_name( connection )
if scoping_instance_name is Null
print 'Failed to find server Scoping Instance.'
sys.exit(-1)
Traverse the
CIM_InstalledSoftwareIdentity association to reach the CIM_SoftwareIdentity
instances that correspond to the software on the managed
server.