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

<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 collection you
want to remove.
The following example creates a new collection called Test Collection with two members, the Test
Query collection and one server. The collection is placed under Systems by Type in the hierarchy.
<?xml version="1.0" encoding="UTF-8" ?>
<collection-list xmlns="http://www.hp.com/hpsim5.1.0.0">
<collection name="Test Collection" type="system" parent="Systems by
Type">
<member name="Test Query" type="query" display-status="0" default-
view="tableview" hidden="false" />
<member name="cupux09" type="node" display-status="0" default-
view="tableview" hidden="false" />
</collection>
</collection-list>
To add to this collection, use the mxcollection –a –f testcoll.xml command, where
testcoll.xml contains the XML shown in the example.
13