Closed GoogleCodeExporter closed 8 years ago
I did several tests and I don't understand the problem for now.
The only thing I see is the website redirect seems not correct:
$ curl -I http://www.mediepanelet.dk
HTTP/1.1 302 Found
Date: Tue, 12 Oct 2010 20:30:28 GMT
Server: Apache/2.2
LOCATION: ?page=forside
ServedBy: vertikal13
Content-Type: text/html
Following http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html, Location
should be an absoluteURI.
With debug the website response seems well handled but the script fails on the
redirection call:
$ ./check_webpage.rb -u www.mediepanelet.dk -vv
* ARGS: c=60 w=5 e=0 w2=10 u=www.mediepanelet.dk
* Get main page: http://www.mediepanelet.dk/
DEBUG 0 [http://www.mediepanelet.dk/]
DEBUG [/] [{"User-Agent"=>"nagios-check-webpage"}]
-> 302, main page is now: ?page=forside
DEBUG 0 [/?page=forside]
DEBUG 1(/) 2(page=forside)
DEBUG [/?page=forside] [{"User-Agent"=>"nagios-check-webpage",
"accept-encoding"=>"gzip;q=1.0,deflate;q=0.6,identity;q=0.3"}]
Critical: error with [/?page=forside]: Connection refused - connect(2)
You can use directly the redirected url to bypass the bug:
http://www.mediepanelet.dk/?page=forside
I will try again later with a debbugger to inspect the objects.
I've also seen some bugs on verbose mode who need to be fixed.
Original comment by toubib....@gmail.com
on 12 Oct 2010 at 8:40
Fair enough - however this (none-RFC compliant) practise, is unfortunately and
appearently well supported in browsers today :(
IMHO it would be nice if the script tried to handle relative uri's in location
url's - but I can understand it if you see it as a malpractice.
Original comment by klavs.Kl...@gmail.com
on 25 Oct 2010 at 11:51
Here's a patch for making redirects follow with the host:
diff check_webpage.rb
345a346
> lastHost = mainUrl.host
347a349,351
> if mainUrl.host.nil?
> mainUrl.host = lastHost
> end
Original comment by christia...@googlemail.com
on 11 Nov 2010 at 2:50
Patch applied on trunk
Original comment by toubib....@gmail.com
on 11 Nov 2010 at 9:22
Original issue reported on code.google.com by
klavs.Kl...@gmail.com
on 6 Oct 2010 at 11:04