in reply to Re^4: LWP for URL monitoring - 500 connect timeout errors
in thread LWP for URL monitoring - 500 connect timeout errors

Well, I had set it before as well, but on scond try I get a slightly different error where its saying the site has moved. >/p>

Z:\>lwp-request -USe -m get http://www.eserve.com.sa/ GET https://www.eserve.com.sa/ User-Agent: lwp-request/5.810 GET http://www.eserve.com.sa/ --> 302 Moved Temporarily GET https://www.eserve.com.sa/ --> 500 Connect failed: connect: Unknow +n error; U nknown error Content-Type: text/plain Client-Date: Tue, 21 Jul 2009 10:41:34 GMT Client-Warning: Internal response 500 Connect failed: connect: Unknown error; Unknown error Z:\>lwp-request -USe -m head http://www.eserve.com.sa/ HEAD https://www.eserve.com.sa/ User-Agent: lwp-request/5.810 HEAD http://www.eserve.com.sa/ --> 302 Moved Temporarily HEAD https://www.eserve.com.sa/ --> 500 Connect failed: connect: Unkno +wn error; Unknown error Content-Type: text/plain Client-Date: Tue, 21 Jul 2009 10:41:58 GMT Client-Warning: Internal response

Replies are listed 'Best First'.
Re^6: LWP for URL monitoring - 500 connect timeout errors
by Anonymous Monk on Jul 21, 2009 at 13:44 UTC
    I too get http://www.eserve.com.sa/ --> 302 Moved Temporarily its normal, website redirects to https, then does a html (refresh) redirect to special/changing url. Makes sense, if you trust HTTPS, you can trust the new url.

      I didn't get the line:

      die sprintf "ERRRR(%d)(%s)(%d)(%s)", $!,$!,$^E,$^E;

      Nor did I get it to work, putting it in as the last line of my code.

      ERRRR(9)(Bad file descriptor)(0)() at C:\SCRIPTING\URLTESTv6.pl line 22.

      As for these redirected websites, the one in question http://www.eserve.com.sa is HTTP. In any case, should I conclude that redirection isn't supported. In that case I'll need to hardcode the eventual address.

        At the end of your code its too late. You're supposed to get more info about which Unknown Error it is. Try
        #!/usr/bin/perl -- use strict; use warnings; use LWP::UserAgent 5.829; @ARGV = qw[ http://www.eserve.com.sa/ ]; my $url = shift or die "URL expected\n"; my $useragent = LWP::UserAgent->new; $useragent->proxy(['http', 'ftp','https'], 'http://192.168.5.39:8080/' +); $useragent -> timeout( 20 ); my $request = HTTP::Request->new( GET => $url ); my $response = $useragent->request($request); my $err = sprintf "(%d)(%s)(%d)(%s)\n", $!,$!,$^E,$^E; print $useragent->proxy('http'),"\n"; print "Err : $err\n"; print $response->dump,"\n"; __END__ lwp-request -useUS -m head http://www.eserve.com.sa/ lwp-request -useUS -m get http://www.eserve.com.sa/
        The number of possible unknown errors is huge (goes into 11_000), to see some run
        for my $i( 0 .. 256 ){ # $! = $i; $^E = $i; printf "(%d)(%s)(%d)(%s)\n", $!,$!,$^E,$^E; }
        As for these redirected websites, the one in question http://www.eserve.com.sa is HTTP.

        Which always redirects to the HTTPs version.

        In any case, should I conclude that redirection isn't supported.

        No.

Re^6: LWP for URL monitoring - 500 connect timeout errors
by Anonymous Monk on Jul 21, 2009 at 13:22 UTC
    Add this to your code
    die sprintf "ERRRR(%d)(%s)(%d)(%s)", $!,$!,$^E,$^E;
    that should give you better idea of exact error (LWP should include this)