Re: automated smtp server check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Am 04.11.2014 um 20:36 schrieb Frank Cox <theatre@xxxxxxxxxxxxxxxxxxx>:
> 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.



mon - old lady but small:

$ yum -y install epel-release ; yum install mon

$ rpm -qi mon |grep -E 'Size|Summary'
Size        : 1155876                          
Summary     : General-purpose resource monitoring system

$ rpm -ql mon | grep -E 'http|imap|smtp|pop&or$'
/usr/lib64/mon/mon.d/http.monitor
/usr/lib64/mon/mon.d/http_tppnp.monitor
/usr/lib64/mon/mon.d/imap.monitor
/usr/lib64/mon/mon.d/phttp.monitor
/usr/lib64/mon/mon.d/smtp.monitor
/usr/lib64/mon/mon.d/smtp3.monitor

$ vi /etc/mon/mon.cf

$ service mon start

$ monshow


and if you like (on EL{5,6}):

$ chkconfig mon on 


--
LF


_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos




[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux