cURL
Haxx ad
libcurl
Automatically get a mirror near you





COMPARE PRICES:
Digital cameras, MP3 Players, Camcorders, Mobile phones, PDA, Computers, Electronics LCD monitors, Printers, Notebook, DVD Players, Motherboards, TV, ipod, Processors. See all...

Shopping cart software
Online collaboration software

SourceForge.net Logo

cURL > Mailing List > Monthly Index > Single Mail

curl-users Mailing List Archives

Re: Checking HTTP/Server with curl

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 27 May 2003 15:59:51 +0200 (CEST)

On Tue, 27 May 2003, Roberto Basso wrote:

> Does anybody know how can i check if an http server/application is working
> through the http port number?

Sure, request a page and see if curl returns an error or not. No error =
working fine.

> I have six port numbers to check because i would like to understand why
> sometimes i cannot download page of my site,suspecting it's not working,and
> using other monitoring products i seems all right.   I didn't find any curl
> option to do this..

I would write a shell script:

#!/bin/sh

# untested code

for port in 21 34 45 56 67 80; do

  curl "https://mysite.com:$port/page.html"
  if [ $? -ne "0" ]; then
    echo "curl return $? which means port $port does not really work"
  fi
done

-- 
 Daniel Stenberg -- curl: been grokking URLs since 1998
-------------------------------------------------------
This SF.net email is sponsored by: ObjectStore.
If flattening out C++ or Java code to make your application fit in a
relational database is painful, don't do it! Check out ObjectStore.
Now part of Progress Software. http://www.objectstore.net/sourceforge
Received on 2003-05-27

These mail archives are generated by hypermail.

donate! Page updated October 16, 2006.
web site info