Skip Menu |
 

This queue is for tickets about the libwww-perl CPAN distribution.

Report information
The Basics
Id: 94723
Status: resolved
Priority: 0/
Queue: libwww-perl

People
Owner: Nobody in particular
Requestors: devarti [...] outlook.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Download (untitled) / with headers
text/plain 168b
Hello, On my Linux server the application is working as well as the curl command works fine however the get method of LWP::Simple does not seem to work LWP 6.05
Download (untitled) / with headers
text/plain 499b
On 2014-04-14 08:30:55, devarti@outlook.com wrote: Show quoted text
> Hello, > > On my Linux server the application is working as well as the curl > command works fine however the get method of LWP::Simple does not seem > to work
This report is useless without more information. "does not seem to work" means what? What did you do (provide some code), what happened (provide output), what did you expect to happen? Have you searched the documentation and looked at the various tutorials for usage of this module?
From: devarti [...] outlook.com
Download (untitled) / with headers
text/plain 1.2k
Here are details. Linux curl output curl http://udbars-wc-01.sys.comcast.net:4090/healthCheck OKServer is healthy"1.8.0-j /usr/lib/nagios/plugins/check_http_ars 4090 CRITICAL, 500 Can't connect to http://udbars-wc-01.sys.comcast.net:4090/healthCheckWithVersion (Connection refused) Perl code that use get method use strict; use warnings; use LWP; use Sys::Hostname; my $host = hostname; my $port = $ARGV[0]; if (not defined $port) { die "Port not defined\n"; } chomp $port; my $url = "http://$host:$port/healthCheckWithVersion"; my $agent = LWP::UserAgent->new; my $request = HTTP::Request->new(GET => $url); my $response = $agent->request($request); if ($response->is_success) { my $output = $response->content; chomp $output; my @lines = split (/\n/, $output); my $out = $lines[1]; chomp $out; my $status = substr $out, 1, -29; chomp $status; if ($status =~ /OK/) { print "$out"; exit 0; } elsif ($status !~ /OK/) { print "CRITICAL, ARS NOT-Healthy, $out"; exit 2; } } else { print "CRITICAL, 500 Can't connect to $url (Connection refused)"; exit 2; }
From: devarti [...] outlook.com
So curl works fine but get method from perl gives HTTP 500
Subject: Re: [rt.cpan.org #94723]
Date: Mon, 14 Apr 2014 12:25:45 -0700
To: "devarti [...] outlook.com via RT" <bug-libwww-perl [...] rt.cpan.org>
From: Karen Etheridge <ether [...] cpan.org>
Download (untitled) / with headers
text/plain 452b
On Mon, Apr 14, 2014 at 02:45:29PM -0400, devarti@outlook.com via RT wrote: Show quoted text
> > Linux curl output > curl http://udbars-wc-01.sys.comcast.net:4090/healthCheck > > OKServer is healthy"1.8.0-j > > /usr/lib/nagios/plugins/check_http_ars 4090 > > CRITICAL, 500 Can't connect to http://udbars-wc-01.sys.comcast.net:4090/healthCheckWithVersion (Connection refused)
healthCheckWithVersion doesn't work on your server. You should test it with curl too.
From: devarti [...] outlook.com
Download (untitled) / with headers
text/plain 621b
Actually both works, sorry i did not include the that perl is using but both works with curl Here: [root@udbars-wc-01 plugins]# ./check_http -I 172.28.88.181 -p 4090 -u /ping -r pong -w 2 -c 5 HTTP OK: HTTP/1.0 200 OK - 87 bytes in 0.000 second response time |time=0.000421s;2.000000;5.000000;0.000000 size=87B;;;0 [root@udbars-wc-01 plugins]# curl http://udbars-wc-01.sys.comcast.net:4090/healthCheck OKServer is healthy"1.8.0-j[root@udbars-wc-01 plugins]# [root@udbars-wc-01 plugins]# [root@udbars-wc-01 plugins]# curl http://udbars-wc-01.sys.comcast.net:4090/healthCheckWithVersion OKfServer is healthy"1.8.0-j*?
Download (untitled) / with headers
text/plain 434b
On Mon Apr 14 15:41:48 2014, devarti@outlook.com wrote: Show quoted text
> [root@udbars-wc-01 plugins]# curl http://udbars-wc- > 01.sys.comcast.net:4090/healthCheckWithVersion > > OKfServer is healthy"1.8.0-j*?
Looks like this doesn't work at all: $ curl http://udbars-wc-01.sys.comcast.net:4090/healthCheckWithVersion curl: (6) Could not resolve host: udbars-wc-01.sys.comcast.net Closing bug, please re-open if you have a reproducable case.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.