[clue-tech] Script to check Apache

Angelo Bertolli angelo at freeshell.org
Thu Apr 17 08:49:06 MDT 2008


Deepan wrote:
> Hi All,
> 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. Can you guys
> suggest on how to go about ? Should I use curl ?
> or wget ? or ping ? I can handle the email part
> and cron part. If you guys have a similar script
> please share it if possible.
> Regards 
> Deepan 
> Sudoku Solver: http://www.sudoku-solver.net/ 
>   
There's a package called monit that may work for you.

I do have a script, but it will have to wait for me to get home because 
I don't think I have a copy here.  It does exactly what you want I 
think:  it checks certain ports on certain hosts.  I used it to make 
sure all my services were running on a trio of servers by having each 
one check the two others periodically and send emails for both warnings 
and errors.  I used netcat, and I didn't check for correct HTTP responses.

So if you're interested, let me know and I'll send it after I get home, 
or if monit works for you, great.

Angelo



More information about the clue-tech mailing list