[CentOS] automated smtp server check

Frank Cox

theatre at melvilletheatre.com
Tue Nov 4 19:36:31 UTC 2014


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:

#!/bin/bash
wget -q --tries=10 --timeout=20 --spider http://melvilletheatre.com
if [[ $? -eq 0 ]]; then
        echo "Online"
else
        echo "Offline"
fi

How can I do the something similar with my mailserver?

Or if someone knows of an integrated tool that will monitor this in a better way (whatever that may be), I'm more than interested.

-- 
MELVILLE THEATRE ~ Real D 3D Digital Cinema ~ www.melvilletheatre.com



More information about the CentOS mailing list