[CentOS] automated smtp server check

Wed Nov 5 16:26:42 UTC 2014
Chris Beattie <cbeattie at geninfo.com>

On 11/4/2014 2:36 PM, Frank Cox wrote:
> I would like to set up a cron job to automatically check whether my mailserver and webserver are up, and tell me if they're not.
> 
> This script tells me if my webserver is up:
...
> How can I do the something similar with my mailserver?

How about a cron job that e-mails you the output of 'service httpd status' or equivalent?  You'll get a message that tells you if your web server is up or not.  If you don't get a message, your mail server is down!  (HHOS.)

Unless you're just collecting performance or availability metrics for reports, how you intend to be notified is something to consider.  It's trivial to have a web server's failing check result e-mailed to you, but you need an out-of-band notification method (an old Nokia phone attached to the serial port that emits an SMS message, for example) if your mail server is having difficulty.

-- 
-Chris