19-5
User Guide for Resource Manager Essentials 4.1
OL-11714-01
Chapter 19 CLI Utilities
CWCLI
</arg>
<arg-val>
tempfile
</arg-val>
</command>
</payload>
The Remote Access servlet creates a temporary file with the contents specified between the arg-val tags
for the import command. On the server the command is executed as
cwcli config import -u admin -p Base64Enoced pwd -device 10.77.240.106 -f tempfile
Here, the tempfile contains the configuration of the device that you want to import.
For example,
perl samplescript.pl http(s)://rme-server:rme-port/rme/cwcli payloadXML
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.
Note For the secure mode (HTTPS) the port number is 443. The default port for CiscoWorks server in HTTP
mode is 1741.

Sample Script to Invoke the Servlet

#!/opt/CSCOpx/bin/perl
use LWP::UserAgent;
$temp = $ARGV[0] ;
$fname = $ARGV[1] ;
open (FILE,"$fname") || die "File open Failed $!";
while ( <FILE> )
{ $str .= $_ ;
}
print $str ;
url_call($temp);
#-- Activate a CGI:
sub url_call
{
my ($url) = @_;
my $ua = new LWP::UserAgent;
$ua->timeout(1000);
# you can set timeout value depending on number of devices
my $hdr = new HTTP::Headers 'Content-Type' => 'text/html';
my $req = new HTTP::Request ('POST', $url, $hdr);