httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jacob Coby" <>
Subject Re: Re[2]: [users@httpd] Testing if a Webserver is down
Date Thu, 31 Oct 2002 16:01:15 GMT
> AST> You could ping the domain in a loop
> AST> ping <IP> -t
> Yes, I know, but how can I check it with a bash script?
> I  pipe  the  output  of  the ping comand through grep and count the
> returned lines? But I really no nothing about bash-programming!

Using ping is a bad idea, it won't give you meaningful results, unless the
server is on fire or turned off.  I've had a webserver here go down (kernel
panic), and it still responds to ping.

Bash is really pretty easy to program for, using wget you can do:


wget -t 1 -T 30 -q

if [ $? == 0 ]; then
  echo 'server is up!';
  echo 'server is down!';

from there, it's just a matter of plugging in your own scripts on what to do
when the server is down :)

Another option is nagios, a daemon that runs on one server and monitors
other servers.  Comes with a web interface with nice features, and can email
or page people responsable for bringing the downed server back up.


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message