10-07-2003
9,926,
461
Join Date: Aug 2001
Last Activity: 26 February 2016, 12:31 PM EST
Location: Ashburn, Virginia
Posts: 9,926
Thanks Given: 63
Thanked 461 Times in 270 Posts
Note that I said "I would use cron to schedule it to run every five minutes". If an error occurs no more than 5 minutes later, cron will run the script. I think that an average wait of 2.5 minutes is acceptable.
What is difference between a script running continuosly looping forever (but with a "sleep 300" statement in the loop) and cron running a script every 5 minutes? The only one I can think of is that if your script dies, you lose monitoring if it was looping but not if cron is running it.
You could even have cron run the script once a minute. Will a one minute maximum wait (30 seconds average) really kill you?
When I send an sms message to my phone, it can take several minutes to arrive. How fast is sms for you? And how fast can you read the message and take corrective action?
It does not make sense to require your script to notice an error in a millisecond and then use sms to notify someone.
If your application is that critical, I suggest sending the error messages to a terminal. Arrange to have someone onsite 24 hours a day, 7 days a week staring intently at the terminal. When the error message occurs, the person can respond in seconds.
We actually do that, except that the person is monitoring about 30 terminals. He has procedures to handle some things, but most problems involve calling someone...and he must actually talk to someone, he does not simply send a page or email.
And even then, the scripts that send the error messages to most of those terminals do indeed involve a delay of a minute ot two.