[AuckLUG] Script to check Apache
Kiirani
kiirani at gmail.com
Fri Apr 18 12:16:43 NZST 2008
A script to wrap 'curl --fail' on the index page would probably be
appropriate for what you're looking for, I had a play with it just now
and the output looks suitable to test for
1) Server existing
2) A server error in the form of a non-200 http code
3) What error it is, so you get an intelligible email
The reason I suggest --fail is it will otherwise output apache's self
generated error pages, which are more annoying to process.
I came up with two sample outputs while playing around -
curl: (22) The requested URL returned error: 403
curl: (7) couldn't connect to host
There's probably a table somewhere in the documentation for what it
will output in what situations.
Otherwise, you probably want either an extension to your preferred
language which can handle this, or something like what was suggested
before.
More information about the AuckLUG
mailing list