Re: [CentOS] automated smtp server check

2014-11-07 Thread Iain Morris
For some fast and free monitoring along with DNS
verification/blacklist/config checks of your MX records, MXToolbox
lets you monitor one domain for free.  Nice to have an external,
independent source checking your public MTA.  Nagios is still what I
would choose for minute-by-minute checks but MXToolbox is free, and
isn't tied to your infrastructure in any way.

On Wed, Nov 5, 2014 at 12:34 PM, Keith Keller
kkel...@wombat.san-francisco.ca.us wrote:
 On 2014-11-05, zep zgreenfel...@gmail.com wrote:

 I'd second nagios, but I think to -really- test smtp, you'd need an
 external email source, a specialized target user and cron on both sides
 (at least that'd how I'd do it, just to be sure mail is really flowing
 through).

 For just testing whether the SMTP server is up (which is what the OP
 originally requested) a nagios check may be sufficient.  As another
 poster mentioned, he could use the check_smtp plugin (e.g., via cron,
 though I agree with you that cron isn't a great tool for monitoring)
 without running a full Nagios server.

 For verifying that delivery is occuring successfully, you'd need more
 what you described, but even that's not going to be foolproof: maybe
 delivery to you is working fine, but delivery to other users isn't
 working properly.  It's really up to the OP, how much work does he
 really want to put in?

 --keith

 --
 kkel...@wombat.san-francisco.ca.us


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



-- 
-- -
Iain Morris
iain.t.mor...@gmail.com
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] automated smtp server check

2014-11-07 Thread Keith Keller
On 2014-11-07, Iain Morris iain.t.mor...@gmail.com wrote:
 For some fast and free monitoring along with DNS
 verification/blacklist/config checks of your MX records, MXToolbox
 lets you monitor one domain for free.  Nice to have an external,
 independent source checking your public MTA.  Nagios is still what I
 would choose for minute-by-minute checks but MXToolbox is free, and
 isn't tied to your infrastructure in any way.

I know we're getting a littl off topic, so I'll ask first: there are a
bunch of external services I use to monitor things like DNS and SMTP
which are difficult to get a true handle on from the inside.  Is it too
off-topic to talk about some of these resources on list?

(MXToolbox looks pretty interesting, I'll look into it for myself
later.)

--keith

-- 
kkel...@wombat.san-francisco.ca.us


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


Re: [CentOS] automated smtp server check

2014-11-07 Thread Les Mikesell
On Fri, Nov 7, 2014 at 1:59 PM, Keith Keller
kkel...@wombat.san-francisco.ca.us wrote:
 On 2014-11-07, Iain Morris iain.t.mor...@gmail.com wrote:
 For some fast and free monitoring along with DNS
 verification/blacklist/config checks of your MX records, MXToolbox
 lets you monitor one domain for free.  Nice to have an external,
 independent source checking your public MTA.  Nagios is still what I
 would choose for minute-by-minute checks but MXToolbox is free, and
 isn't tied to your infrastructure in any way.

 I know we're getting a littl off topic, so I'll ask first: there are a
 bunch of external services I use to monitor things like DNS and SMTP
 which are difficult to get a true handle on from the inside.  Is it too
 off-topic to talk about some of these resources on list?

 (MXToolbox looks pretty interesting, I'll look into it for myself
 later.)

If you want to run your own - and have remote systems to handle it,
opennms can run remote monitor agents  (via java remoting) that report
back to the central server.

-- 
Les Mikesell
   lesmikes...@gmail.com
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] automated smtp server check

2014-11-05 Thread Eliezer Croitoru
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

It could be done using a crontab job and it's very efficient sometimes
to use only a crontab job instead of nagios.

You can use the precompiled nagios scripts for the task.
Unless you have constrains on the OS allowed languages and packages,
which then should be evaluated more deeply to meet your needs which
might be missing.

So:
- - Nagios scripts as crontab job
- - Other tcp level scripts as a crontab job
- - fully fledged nagios
- - other relevant solutions in your scope

Eliezer

On 11/04/2014 09: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.

-BEGIN PGP SIGNATURE-
Version: GnuPG v1

iQEcBAEBAgAGBQJUWehzAAoJENxnfXtQ8ZQUaIEH/AtTmVDT7XN7uiFHSvPQRyEI
Azb2L+RSMbvRq+n8yBx52D04F6A0YvRGYzA2/4i6ZK8ai3PV9DN1Y8IRim8PvNbf
UvvQAVA4XvKT/nDSQJHP7GldcUS0WBPTm4BP/MAl1QYM5CPhc5FoP9+UhUgELxoj
ZMzE58T+3XtzpQ5jeGELv9Oratz/zCIi+ysCdoJmoBgBd5Zg3Rfq53UGCxlKK6QB
pfAYR0wfKn4O5Yo+EHTHlDHM+PIUzqdEKPtCWWigPhGAiLyrbMXHLL+PM3Tw2wZ8
82She07GAmyqyAkwBvi92z74fedMyjFEcgodEk0PbZpRN6JsWSmF0sxwcy4RZiA=
=yLLM
-END PGP SIGNATURE-
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] automated smtp server check

2014-11-05 Thread zep

On 11/04/2014 02:44 PM, John R Pierce wrote:
 On 11/4/2014 11:36 AM, Frank Cox wrote:
 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.

 Nagios

I'd second nagios, but I think to -really- test smtp, you'd need an
external email source, a specialized target user and cron on both sides
(at least that'd how I'd do it, just to be sure mail is really flowing
through).I also don't think cron for monitoring is a terribly good
idea.   and I think you also need to consider the implications of how
you send out your alerts based on what you monitor.e.g. oh no ..
email is down!   quick!  fetch me an admin; send an emai... d'oh!

-- 
public gpg key id: AE60F64C

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


Re: [CentOS] automated smtp server check

2014-11-05 Thread Chris Beattie
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
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] automated smtp server check

2014-11-05 Thread Bowie Bailey

On 11/4/2014 7:35 PM, Frank Cox wrote:

On Tue, 4 Nov 2014 23:41:36 +0100
Leon Fauster wrote:


mon - old lady but small:

It looks really cool, but boy does it have a list of dependencies:

fping is needed by mon-1.2.0-8.el7.centos.x86_64
perl(Authen::PAM) is needed by mon-1.2.0-8.el7.centos.x86_64
perl(Authen::Radius) is needed by mon-1.2.0-8.el7.centos.x86_64
perl(CGI) is needed by mon-1.2.0-8.el7.centos.x86_64
perl(DBI) is needed by mon-1.2.0-8.el7.centos.x86_64
perl(Expect) is needed by mon-1.2.0-8.el7.centos.x86_64
perl(Mon::Client) is needed by mon-1.2.0-8.el7.centos.x86_64
perl(Net::DNS) is needed by mon-1.2.0-8.el7.centos.x86_64
perl(Net::DNS::Packet) is needed by mon-1.2.0-8.el7.centos.x86_64
perl(Net::DNS::RR) is needed by mon-1.2.0-8.el7.centos.x86_64
perl(Net::DNS::Resolver) is needed by mon-1.2.0-8.el7.centos.x86_64
perl(Net::LDAP) is needed by mon-1.2.0-8.el7.centos.x86_64
perl(Net::SNPP) is needed by mon-1.2.0-8.el7.centos.x86_64
perl(Net::Telnet) is needed by mon-1.2.0-8.el7.centos.x86_64
perl(SNMP) is needed by mon-1.2.0-8.el7.centos.x86_64
perl(SNMP) = 1.8 is needed by mon-1.2.0-8.el7.centos.x86_64
perl(Statistics::Descriptive) is needed by mon-1.2.0-8.el7.centos.x86_64
perl(Sys::Syslog) is needed by mon-1.2.0-8.el7.centos.x86_64
perl(Time::HiRes) is needed by mon-1.2.0-8.el7.centos.x86_64
perl(Time::Period) is needed by mon-1.2.0-8.el7.centos.x86_64


It's a Perl program designed to test a bunch of different services. Of 
course it's going to require the Perl modules needed to do those queries.


--
Bowie
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] automated smtp server check

2014-11-05 Thread Keith Keller
On 2014-11-05, zep zgreenfel...@gmail.com wrote:

 I'd second nagios, but I think to -really- test smtp, you'd need an
 external email source, a specialized target user and cron on both sides
 (at least that'd how I'd do it, just to be sure mail is really flowing
 through).

For just testing whether the SMTP server is up (which is what the OP
originally requested) a nagios check may be sufficient.  As another
poster mentioned, he could use the check_smtp plugin (e.g., via cron,
though I agree with you that cron isn't a great tool for monitoring)
without running a full Nagios server.

For verifying that delivery is occuring successfully, you'd need more
what you described, but even that's not going to be foolproof: maybe
delivery to you is working fine, but delivery to other users isn't
working properly.  It's really up to the OP, how much work does he
really want to put in?

--keith

-- 
kkel...@wombat.san-francisco.ca.us


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


[CentOS] automated smtp server check

2014-11-04 Thread Frank Cox
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
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] automated smtp server check

2014-11-04 Thread John R Pierce

On 11/4/2014 11:36 AM, Frank Cox wrote:

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.


Nagios.



--
john r pierce  37N 122W
somewhere on the middle of the left coast

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


Re: [CentOS] automated smtp server check

2014-11-04 Thread José María Terry Jiménez

El 04/11/14 a las 20:36, Frank Cox escribió:

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.


Hello

I use Nmap to test if a server up in a port:

$ nmap -p587 a.mail.server |grep -i 587

587/tcp open  submission

Or several ports:

$ nmap -p25,143,587 a.mail.server |grep -i open
25/tcp  open  smtp
143/tcp open  imap
587/tcp open  submission

If the server is working, the port is shown as open. You can parse it as 
desired to message you as you want


Best
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] automated smtp server check

2014-11-04 Thread Steve Clark

On 11/04/2014 02:49 PM, José María Terry Jiménez wrote:

El 04/11/14 a las 20:36, Frank Cox escribió:

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.


Hello

I use Nmap to test if a server up in a port:

$ nmap -p587 a.mail.server |grep -i 587

587/tcp open  submission

Or several ports:

$ nmap -p25,143,587 a.mail.server |grep -i open
25/tcp  open  smtp
143/tcp open  imap
587/tcp open  submission

If the server is working, the port is shown as open. You can parse it as
desired to message you as you want

Best
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


How about using nc with something like this:
No server listening at 10.0.129.71
$ nc 10.0.129.71 25  EOF
QUIT
EOF
$ echo $?
1



Server listening at localhost
$ nc localhost 25  EOF
QUIT
EOF
220 sclark66.netwolves.com ESMTP Sendmail 8.14.4/8.14.4; Tue, 4 Nov 2014 
15:03:22 -0500
221 2.0.0 sclark66.netwolves.com closing connection
$ echo $?
0



--
Stephen Clark
*NetWolves Managed Services, LLC.*
Director of Technology
Phone: 813-579-3200
Fax: 813-882-0209
Email: steve.cl...@netwolves.com
http://www.netwolves.com
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] automated smtp server check

2014-11-04 Thread Les Mikesell
On Tue, Nov 4, 2014 at 1:36 PM, Frank Cox thea...@melvilletheatre.com wrote:
 
 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.


Overkill for one or a few sites, but:
http://www.opennms.org/
can monitor most network services with a framework for alarms and
notifications, plus keeping nice graph histories of snmp data
(interface traffic, cpu/disk/memory use, etc.

-- 
   Les Mikesell
 lesmikes...@gmail.com
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] automated smtp server check

2014-11-04 Thread Leon Fauster
Am 04.11.2014 um 20:36 schrieb Frank Cox thea...@melvilletheatre.com:
 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|popor$'
/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@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] automated smtp server check

2014-11-04 Thread Frank Cox
On Tue, 4 Nov 2014 23:41:36 +0100
Leon Fauster wrote:

 mon - old lady but small:

It looks really cool, but boy does it have a list of dependencies:

fping is needed by mon-1.2.0-8.el7.centos.x86_64
perl(Authen::PAM) is needed by mon-1.2.0-8.el7.centos.x86_64
perl(Authen::Radius) is needed by mon-1.2.0-8.el7.centos.x86_64
perl(CGI) is needed by mon-1.2.0-8.el7.centos.x86_64
perl(DBI) is needed by mon-1.2.0-8.el7.centos.x86_64
perl(Expect) is needed by mon-1.2.0-8.el7.centos.x86_64
perl(Mon::Client) is needed by mon-1.2.0-8.el7.centos.x86_64
perl(Net::DNS) is needed by mon-1.2.0-8.el7.centos.x86_64
perl(Net::DNS::Packet) is needed by mon-1.2.0-8.el7.centos.x86_64
perl(Net::DNS::RR) is needed by mon-1.2.0-8.el7.centos.x86_64
perl(Net::DNS::Resolver) is needed by mon-1.2.0-8.el7.centos.x86_64
perl(Net::LDAP) is needed by mon-1.2.0-8.el7.centos.x86_64
perl(Net::SNPP) is needed by mon-1.2.0-8.el7.centos.x86_64
perl(Net::Telnet) is needed by mon-1.2.0-8.el7.centos.x86_64
perl(SNMP) is needed by mon-1.2.0-8.el7.centos.x86_64
perl(SNMP) = 1.8 is needed by mon-1.2.0-8.el7.centos.x86_64
perl(Statistics::Descriptive) is needed by mon-1.2.0-8.el7.centos.x86_64
perl(Sys::Syslog) is needed by mon-1.2.0-8.el7.centos.x86_64
perl(Time::HiRes) is needed by mon-1.2.0-8.el7.centos.x86_64
perl(Time::Period) is needed by mon-1.2.0-8.el7.centos.x86_64


-- 
MELVILLE THEATRE ~ Real D 3D Digital Cinema ~ www.melvilletheatre.com
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] automated smtp server check

2014-11-04 Thread Laurent Dumont
Monit could do the job. It's probably slightly overkill but it doesn't 
do graph. It's purely a is this service answering on that host type of 
monitoring.


http://mmonit.com/monit/


On 11/4/2014 7:35 PM, Frank Cox wrote:

On Tue, 4 Nov 2014 23:41:36 +0100
Leon Fauster wrote:


mon - old lady but small:

It looks really cool, but boy does it have a list of dependencies:

fping is needed by mon-1.2.0-8.el7.centos.x86_64
perl(Authen::PAM) is needed by mon-1.2.0-8.el7.centos.x86_64
perl(Authen::Radius) is needed by mon-1.2.0-8.el7.centos.x86_64
perl(CGI) is needed by mon-1.2.0-8.el7.centos.x86_64
perl(DBI) is needed by mon-1.2.0-8.el7.centos.x86_64
perl(Expect) is needed by mon-1.2.0-8.el7.centos.x86_64
perl(Mon::Client) is needed by mon-1.2.0-8.el7.centos.x86_64
perl(Net::DNS) is needed by mon-1.2.0-8.el7.centos.x86_64
perl(Net::DNS::Packet) is needed by mon-1.2.0-8.el7.centos.x86_64
perl(Net::DNS::RR) is needed by mon-1.2.0-8.el7.centos.x86_64
perl(Net::DNS::Resolver) is needed by mon-1.2.0-8.el7.centos.x86_64
perl(Net::LDAP) is needed by mon-1.2.0-8.el7.centos.x86_64
perl(Net::SNPP) is needed by mon-1.2.0-8.el7.centos.x86_64
perl(Net::Telnet) is needed by mon-1.2.0-8.el7.centos.x86_64
perl(SNMP) is needed by mon-1.2.0-8.el7.centos.x86_64
perl(SNMP) = 1.8 is needed by mon-1.2.0-8.el7.centos.x86_64
perl(Statistics::Descriptive) is needed by mon-1.2.0-8.el7.centos.x86_64
perl(Sys::Syslog) is needed by mon-1.2.0-8.el7.centos.x86_64
perl(Time::HiRes) is needed by mon-1.2.0-8.el7.centos.x86_64
perl(Time::Period) is needed by mon-1.2.0-8.el7.centos.x86_64




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