19-75
User Guide for Resource Manager Essentials 4.1
OL-11714-01
Chapter 19 CLI Utilities
CWCLI
The cwcli inventory command is located in the following directories, where install_dir is the directory
in which CiscoWorks is installed:
On UNIX systems, /opt/CSCOpx/bin
On Windows systems, install_dir\CSCOpx\bin
The default install directory is C:\Program Files.
If you install RME on an NTFS partition on Windows, only users in the administrator or casuser group
can access cwcli inventory.
You can also perform the cwcli inventory tasks using the servlet. You will have to upload a payload
XML file, which contains the cwcli inventory command arguments and CiscoWorks user credentials.
You have to write your own script to invoke the servlet with a payload of this XML file and the servlet
returns the output either on the console or in the specified output file, if the credentials are correct and
arguments are valid.
The name of the servlet is /rme/cwcli.
The following is the servlet to be invoked to execute any command:
For post request,
perl samplepost.pl http://rme-server:rme-port/rme/cwcli payload_XML_file
The default port for CiscoWorks server in HTTP mode is 1741.
If you have enabled SSL on CiscoWorks server, you can also use https protocol for secured connection.
perl samplepost.pl https://rme-server:rme-port/rme/cwcli payload_XML_file
The default port for CiscoWorks server in HTTPS mode is 443.
The schema for creating the payload file in XML format is:
<payload>
<command>
cwcli inventory commandname -u user -p BAse64 encoded pwd -args1 arg1value...
</command>
</payload>
To invoke the servlet using a script, see the Sample Script to Invoke the Servlet.
The script and the payload file should be residing in the client machine.
For get request,
http://rme-server:rme-port/rme/cwcli?command=cwcli inventory commandname -u user -p BAse64
encoded pwd -args1 arg1value...
The default port for CiscoWorks server in HTTP mode is 1741.
If you have enabled SSL on CiscoWorks server, you can also use https protocol for secured connection.
https://rme-server:rme-port/rme/cwcli?command=cwcli inventory commandname -u user -p
BAse64 encoded pwd -args1 arg1value...
The default port for CiscoWorks server in HTTPS mode is 443.
The BAse64 encoded for “admin” is YWRtaW4=.
The URL encode for,
Double quotes (“) is %22