19-59
User Guide for Resource Manager Essentials 4.1
OL-11714-01
Chapter 19 CLI Utilities
CWCLI
To invoke the servlet using a script, see the Sample Script to Invoke the Servlet.
Running cwcli export inventory Command
Using this command you can export inventory data in the XML format.
The command syntax for cwcli export inventory is:
cwcli export inventory {-u username -p password}[-d debuglevel] [-m mailid] [-l logfile] [-f filename]
{-device devicename | -input inputfilename | -view viewname | - ipaddress mgmt-ip-address} [-hop
hopdevice]
The above command retrieves the inventory data in XML format specified by the schema. The -f
parameter stores the output in the file specified by filename. If you have not specified the filename, the
output is stored at the following location:
PX_DATADIR/rme/archive/timestampinventory.xml
Where PX_DATADIR is the NMSROOT/files directory and NMSROOT is the RME installed directory.
The device name can also have a wild card symbol "%" to choose all devices with that particular name.
If the number of devices is large, the list of devices can be stored in an input file and the name of the
input file can be given in the command line.The input argument cannot occur with the device or view
arguments.
If the data needs to be generated for all the devices in a specific group, you can use the -view argument.
You can use this argument to generate data for devices in all RME device groups including
system-defined groups and user-defined groups.
The following table describes the arguments that are specific to cwcli export inventory command.
The other common arguments used by cwcli export are explained in Using the cwcli export Command.
Given below is the list of combinations, which could occur for the inventory command.
cwcli export inventory -u admin -p admin -f myinv.xml
cwcli export inventory -u admin -p admin -f myinv.xml -device device1
cwcli export inventory -u admin -p admin -device device%
cwcli export inventory -u admin -p admin -input inv.txt
cwcli export inventory -u admin -p admin -view "/RME@ciscoworksservername/Normal Devices"
cwcli export inventory -u admin -p admin -f myinv.xml -input inv.txt
To apply the cwcli export command on more than one CiscoWorks device you must use the format in
the example given below. The parameter, inputlist, is a text file which will have the list of device names
separated by a new line. A line starting with # will be treated as a comment.
Example:
#comment
Arguments Description
-hop hopdevice Optional
Used to increase performance by using more memory. This indicates the number of devices to be
worked upon at a time. By default, this value is 1.