HP Systems Insight Manager 7.2 Command Line Interface Guide

<member name="Login Events" display-status="-1" type="collection"
default-view="none" hidden="false" />
<member name="Service Events" display-status="-1" type="collection"
default-view="none" hidden="false" />
</collection>
</collection-list>
As shown in the hierarchy above, both the Systems and Events collections contain a sub-collection
called Shared. The items shown for the Shared collection are the same as what is shown above
in the hierarchy list, with one notable exception. The example query collection is shown as part of
the lf output for a collection, but not in the ln output. This is because ln only displays the names
of the collections, and a query is not a collection. The lf option displays all of the members of
a collection, which can include both collections and query collections.
The mxcollection(4)man page details the XML schema for creating collections. When creating
collections, you define the name of the collection, whether it is a system or event collection, where
the collection is placed in the hierarchy, and all of the members. The collection members can be
collections, systems or events (depending on the collection type), or nodes in the system. The
following is an example of a system collection that has another collection and one node as its
members:
<?xml version="1.0" encoding="UTF-8" ?>
<collection-list xmlns="http://www.hp.com/hpsim5.1.0.0">
<collection name="Example" type="system" parent="Systems by Type">
<member name="All Servers" type="query" display-status="0"
default-view="tableview" hidden="false" />
<member name="server001" type="node" display-status="0"
default-view="tableview" hidden="false" />
</collection>
</collection-list>
In this example, the system collection is placed under Systems by Type in the hierarchy and contains
two members, the collection All Servers, and the node server001. The type field is very important
distinguishing collections, because you can have collections with the same name reside under
Systems or Events.
To add collections and members of collections to HP SIM, use the a f collection.xml
option, where collection.xml contains the XML description, as shown above. For example:
# mxcollection a f collection.xml
The following example shows the XML required to add the query collection, Test Query, to the
Shared collection under Systems:
<?xml version="1.0" encoding="UTF-8" ?>
<collection-list xmlns="http://www.hp.com/hpsim5.1.0.0">
<collection name="Shared" type="system">
<member name="Test Query" display-status="0" type="query"
default-view="tableview" hidden="false" />
</collection>
</collection-list>
Because the collection Shared already exists, you only need to add the members to the collection.
To add new members to the collections, use the following command:
# mxcollection a mem f testcoll.xml
Where testcoll.xml contains the XML shown above.
To remove members of collections, replace the a option with r. Using this option removes all
of the members defined in the XML from the collection specified in the file testcoll.xml. To
remove the collection itself, use the d CollName option, where CollName is the name of the
142 Infrastructure management using CLI