in reply to Re: Fetch output coming as an xml format
in thread Fetch output coming as an xml format

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.

Replies are listed 'Best First'.
Re^3: Fetch output coming as an xml format
by Anonymous Monk on Feb 19, 2015 at 14:04 UTC
    Any Update ??
      you can see, one has to open a browser and run - http://localhost:20000/a-getstatus

      I don't see that, I see http://server name:ACI interface port/action=GetStatus, where port is either 2000 or 52000

      poj