Infrastructure management using the HP SIM command line interface (436331-002, January 2009)

The mxcollection command enables you to add, modify, remove, or list collections, or members
within a collection in HP SIM. A full description for mxcollection exists in the mxcollection man
page, and a full description of the XML syntax required to manage collections through an XML file
exists in the mxcollection(4) man page. Use the mxquery command to add, modify, list, remove, and
execute query collections. Full descriptions of the command and the XML format for query collections
are available in the mxquery and mxquery(4) man pages, respectively.
In earlier releases of HP SIM, you could not create or alter categories using the mxquery command.
Beginning with HP SIM 5.0, collections are an extension of categories, you can manage with the
mxcollection command. The mxcollection command enables you to select members
individually by name. You must continue to use the mxquery command to the search attributes when
creating and managing queries.
The mxquery command provides many options to help create and manage query collections. The
following XML is an example of a query collection, called Test Query.
<?xml version="1.0" encoding="ISO-8859-1"?>
<query-list>
<query id="64" name="Test Query" type="DeviceViews" category-
name="SysSharedLists" owner="root">
<criteria name="CriteriaByOSNameComparison" sense="INCLUDE">
<value operator="contains">HP</value>
</criteria>
<criteria name="ProductByName" sense="INCLUDE">
<value>ia64</value>
</criteria>
<criteria name="CriteriaByNameComparison" sense="INCLUDE">
<value operator="contains">ABC</value>
</criteria>
</query>
</query-list>
This query finds all systems that have HP in the operating system name, ia64 in the product name,
and ABC in the system name. To get this output, use the following command,
# mxquery –lf “Test Query
The -lf option displays the output in XML format for the specified query collection. If you do not
specify a query collection name, the XML for all collections and query collections are displayed. If you
specify a collection name, an error appears stating no such query exists.
The mxquery command uses the following options to display query information:
The -l cat option lists all collections where you can add a query collection
The -l crit option lists the criteria that can be used to construct a query collection
The -l mode “crit option lists the operators that can be used with criteria “crit
The -l val “crit option lists the defined values associated with criteria “crit
If the criteria type is
Text, then there are no associated values for the criteria.
From the example above, the output for the mxquery –l mode CriteriaByNameComparison
command is:
does not start with
does not contain
9