| [reply] |
use LWP;
use LWP::UserAgent;
$host = '16.183.90.81';
$port = '8004';
$uri = '/a=getstatus';
$http = 'http';
$lwp_user_agent = LWP::UserAgent->new;
$lwp_user_agent->timeout($timeout);
if ( $port == 80 || $port == 443 || $port eq "" ) {
$lwp_user_agent->default_header('Host' => $host);
} else {
$lwp_user_agent->default_header('Host' => "$host:$port");
}
$url = "$http://$host:${port}$uri";
$http_request = HTTP::Request->new(GET => $url);
print "--------------- GET $url";
print $lwp_user_agent->default_headers->as_string . $http_request->hea
+ders_as_string;
$http_response = $lwp_user_agent->request($http_request);
print "---------------\n" . $http_response->protocol . " " . $http_res
+ponse->status_line;
print $http_response->headers_as_string;
print "Content has " . length($http_response->content) . " bytes \n";
if ($http_response->is_success) {
$body = $http_response->content;
print $body;
}
This above script when I use for particular site, running on my machine on port 8004, then I'm able to get the output accordingly.
But, when I use this script on another machine, on port 20000, then I m not getting any output.
Please see the link below for which ACI port i'm talking about and not getting any output for this case.
https://www.novell.com/documentation/extend52/Docs/help/exteNd/books/e
+xt521_Autonomy.html
this is the same exact scenerio, there you can see, one has to open a browser and run - http://localhost:20000/a-getstatus . I too want to query the interface port through perl and see the output. | [reply] [d/l] [select] |