500 Can't connect to miniwall.foo.com:80 (connect: Invalid argument) #### LWP::UserAgent::request: () LWP::UserAgent::send_request: GET http://miniwall.foo.com/update-4.0/net4801/etc-files/nrpe.cfg LWP::UserAgent::_need_proxy: Not proxied LWP::Protocol::http::request: () LWP::Protocol::collect: read 624 bytes LWP::Protocol::collect: read 4096 bytes LWP::Protocol::collect: read 1539 bytes LWP::UserAgent::request: Simple response: OK #### LWP::UserAgent::request: () LWP::UserAgent::send_request: GET http://miniwall.foo.com/update-4.0/net4801/scripts/ping-gw-by-int.pl LWP::UserAgent::_need_proxy: Not proxied LWP::Protocol::http::request: () LWP::UserAgent::request: Simple response: Internal Server Error #### LWP::UserAgent::request: Simple response: Internal Server Error #### # GOAL : download a copy of the remote file my $file_url = $base_url . $remote_file; my $ua = LWP::UserAgent->new; my $req = GET $file_url; my $downloaded = 0; # 0 = not d/l , 1 = d/l my $tries = 4; while( (! $downloaded) and ($tries >= 0) ) { -- $tries; #print "tries: $tries\n"; $req->authorization_basic('mwuser', 'mwpass'); my $response = $ua->request($req); my $file_content = $ua->request($req)->content; # print $file_content; my $md5_is_good; check_file_md5($file_url, $file_content, \$md5_is_good); #print "md5_is_good: $md5_is_good\n"; if ($response->is_success and $md5_is_good) { $downloaded = 1; } else { my $msg = "$0: unable to get file. '$file_url'" . " '" . $response->code. "'" . " '" . status_message($response->code). "'" ; unless ($md5_is_good) { $msg .= " MD5 sum mismatch error"; } warn $msg; if ($tries < 0) { next CFG_KEY; # next file to download } else { print "re-trying $file_url\n"; } } } my $file_content = $ua->request($req)->content; # print $file_content; #### my $file_content = $ua->request($req)->content; #### 30481 perl CALL connect(0x3,0x85b8bae0,0x10) 30481 perl RET connect -1 errno 22 Invalid argument #### my $response = $ua->request($req); my $file_content = $ua->request($req)->content; #### my $response = $ua->request($req); my $file_content = $response->content;