[clue-tech] Script to check Apache
Jed S. Baer
cluemail at jbaer.cotse.net
Thu Apr 17 09:17:59 MDT 2008
On Thu, 17 Apr 2008 13:17:44 +0530
Deepan wrote:
> I am looking for a script to check if Apache is up
> and running, if not the script should send an
> email automatically. The script has to be run from
> a different machine (not from the machine that
> runs apache). So it has to query for a http
> address and if it receives any other reply that
> 200 OK, it should send the email.
Well, this should do it:
HEAD http://google.com/ | grep -q '200 OK' || mail ...
Use whatever URL is appropriate, and finish the mail command
Note that it doesn't exactly check that Apache is up, but if that machine
is reachable from the machine where you run the command, it'll check if
Apache is responding.
More information about the clue-tech
mailing list