19-93
User Guide for Resource Manager Essentials 4.1
OL-11714-01
Chapter 19 CLI Utilities
CWCLI
12.18.13.129:ALIAS
10.7.9.13:PREDEPLOYED
10.6.12.21:NORMAL
12.20.12.26:NORMAL
SUMMARY
========
Successful: getdevicestate: Success
<!-- Processing complete -->
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);
$req->content($str);
my $res = $ua->request ($req);
my $result;
if ($res->is_error)
{
print "ERROR : ", $res->code, " : ", $res->message, "\n"; $result = '';
}
else {
$result = $res->content;
if($result =~ /Authorization error/)
{ print "Authorization error\n";
}
else {
print $result ;
}
}
Overview: cwcli invreport Command
The cwcli invreport is a CiscoWorks command line tool which allows you to run previously created