Introduction¶
OpenLMI Software provider allows to query and manipulate software package database on remote hosts. They utilize YUM which is a standard package manager for several GNU/Linux distributions. They provide the subset of its functionality.
RPM database, repositories and the package manager itself are modeled with CIM classes according to several DMTF profiles described later. To make a query on database, install, update a remove some RPM package means to trigger some operation on one or several CIM classes. This page explains the mapping of mentioned objects to corresponding classes.
Classes with the blue background belong to Software Inventory Profile. Classes painted yellow belong to Software Update Profile that builds on the former one. Classes painted red/pink are extensions not beloning to any DMTF profile.
Mapping of objects to CIM classes¶
- RPM package : LMI_SoftwareIdentity
Is represented by LMI_SoftwareIdentity. It’s identified by a single key property called LMI_SoftwareIdentity.InstanceID. This is a composition of some CIM related prefix with package’s NEVRA string. It’s the similar string you may see, when listing package with rpm tool:
$ rpm -qa 'openlmi-*' vim-enhanced openlmi-python-base-0.3.0_5_gf056906-2.fc21.noarch openlmi-providers-0.3.0_5_gf056906-2.fc21.x86_64 openlmi-indicationmanager-libs-0.3.0_5_gf056906-2.fc21.x86_64 openlmi-account-0.3.0_5_gf056906-2.fc21.x86_64 openlmi-service-0.3.0_5_gf056906-2.fc21.x86_64 vim-enhanced-7.4.027-2.fc20.x86_64 openlmi-logicalfile-0.3.0_5_gf056906-2.fc21.x86_64 openlmi-storage-0.6.0-2.fc20.noarch openlmi-python-providers-0.3.0_5_gf056906-2.fc21.noarch openlmi-providers-debuginfo-0.3.0_5_gf056906-2.fc21.x86_64 openlmi-software-0.3.0_5_gf056906-2.fc21.noarch
except for Epoch part, which is omitted by rpm tool but is required to be present in InstanceID by instrumenting provider. To get the expected output, the above command needs to be modified:
$ rpm --qf '%{NAME}-%{EPOCH}:%{VERSION}-%{RELEASE}.%{ARCH}\n' -qa 'openlmi-*' | sed 's/(none)/0/' openlmi-python-base-0:0.3.0_5_gf056906-2.fc21.noarch openlmi-providers-0:0.3.0_5_gf056906-2.fc21.x86_64 openlmi-indicationmanager-libs-0:0.3.0_5_gf056906-2.fc21.x86_64 openlmi-account-0:0.3.0_5_gf056906-2.fc21.x86_64 openlmi-service-0:0.3.0_5_gf056906-2.fc21.x86_64 vim-enhanced-2:7.4.027-2.fc20.x86_64 openlmi-logicalfile-0:0.3.0_5_gf056906-2.fc21.x86_64 openlmi-storage-0:0.6.0-2.fc20.noarch openlmi-python-providers-0:0.3.0_5_gf056906-2.fc21.noarch openlmi-providers-debuginfo-0:0.3.0_5_gf056906-2.fc21.x86_64 openlmi-software-0:0.3.0_5_gf056906-2.fc21.noarch
Some RPM packages do not define Epoch part, which means its 0 although rpm returns (none).
When installing, updating or removing package, we operate upon an instance or object path of this class.
See also
- Repository : LMI_SoftwareIdentityResource
Is represented by LMI_SoftwareIdentityResource. What distinguishes particular repository from others on the same system is a LMI_SoftwareIdentityResource.Name key property. It’s the name of repository written in square brackets in repository config. Not the configuration file name, not the name option, but a the name of section. See the example of OpenLMI Nightly repository:
$ cat /etc/yum.repos.d/openlmi-nightly.repo [openlmi-nightly] name=OpenLMI Nightly baseurl=http://openlmi-rnovacek.rhcloud.com/rpm/rawhide/ gpgcheck=0 enabled = 1
The Name property of corresponding Software Identity Resource will be openlmi-nightly.
- Installed file : LMI_SoftwareIdentityFileCheck
Is represented by LMI_SoftwareIdentityFileCheck. Represents a verification check of particular file installed by RPM package. It contains attributes being checked, like:
- User ID, Group ID
- Checksum
- Link Target
- File Mode and others
Each is present twice. One property represents the current value of installed file and the other the value stored in RPM package, that the file should have. The later properties have Original suffix. So for example:
Mentioned attributes are compared when the package verification is done. Single file can also be easily checked. Either by running LMI_SoftwareIdentityFileCheck.Invoke() method on particular object path or by testing the FailedFlags property for emptiness. If its empty, the file or directory passed the verification test.
- RPM database : LMI_SystemSoftwareCollection
- Is represented by LMI_SystemSoftwareCollection. Administrator probably won’t be interested in this class. The LMI_MemberOfSoftwareCollection association class associates this collection with available and installed Software Identities. It can not be enumerated — due to the same reason as in case of LMI_SoftwareIdentity (see the explanation in Package searching).
- YUM package manager : LMI_SoftwareInstallationService
Is represented by LMI_SoftwareInstallationService. Allows to query the database, install, update, verify and remove RPM packages. All of this can be achieved by invocations of its methods:
- FindIdentity()
- Allows to query the database for matching packages.
- InstallFromSoftwareIdentity()
- Allows to install, update or remove RPM package represented by an instance of Software Identity.
- InstallFromURI()
- Allows to install or update RPM package located with particular URI string.
- VerifyInstalledIdentity().
- Runs a verification check on given Software Identity.
See also
Examples on using above methods: