On Wed, 2007-10-24 at 13:04 +0100, Matthew wrote:
Secondly, I really ought to have some mechanism to check on Apache (and MySQL) periodically and make sure they're running, either restarting them or alerting me (although I can be difficult to get hold of). What do people recommend for this? Is it as simple as having cron run a script to start the daemon if it's not already on the stored PID, or are there issues I should be wary of?
Seconding what Brett said, back in circa 2000-2001 when I was responsible for a subscription based online game server and some e-commerce running at a co-lo I had a script running from another location that connected to various ports to gather known content or responses and if it didn't like what it saw it emailed a one liner (mysql on host x down) to a sms gateway we ran.
Of course I thought this was really clever until the first time the damn thing went of at 3AM
The advantage being of course there are several reasons for the service to be down but the daemon is still running. Connectivity or routing issues included. Also if you monitor this from the same box then what happens if the whole box goes down ?