Home Directory Plugins Email and Groupware check_email_delivery

Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

check_email_delivery

Rating
5 votes
Favoured:
2
Last Release Date
2011-11-11
Compatible With
  • Nagios 1.x
  • Nagios 2.x
  • Nagios 3.x
License
GPL
Hits
136426
Files:
FileDescription
LICENSE.txtLICENSE.txt
check_email_delivery-0.7.1.zipcheck_email_delivery-0.7.1.zip
check_email_delivery-0.7.1.tar.gzcheck_email_delivery-0.7.1.tar.gz
Network Monitoring Software - Download Nagios XI
Log Management Software - Nagios Log Server - Download
Netflow Analysis Software - Nagios Network Analyzer - Download
Package of 4 plugins: check_smtp_send, check_imap_receive, check_imap_quota, and check_email_delivery.

The check_email_delivery plugin uses the included plugins (or any other plugin you specify) to check on a complete email loop. SMTP, IMAP plugins also work alone.

The plugins support SSL and the check_imap_receive plugin can also verify the server certificate. Use the included utility imap_ssl_cert to download the server's SSL certificate into a file that can be used with the check_imap_receive --ssl-ca-file option.
Includes check_smtp_send, check_imap_receive, and check_email_delivery which checks the complete delivery loop using the smtp and imap plugins.

You can use check_smtp_send and check_imap_receive independently, and you can use check_email_delivery to check that an email loop is working.

Features of check_smtp_send:

* custom headers
* custom body message
* can accept body message from stdin
* TLS and authentication support (requires Net::SMTP::TLS, available on CPAN)


Features of check_imap_receive:

* select which mailbox to check (defaults to INBOX)
* use IMAP search feature to select only relevant messages
* capture-max option enables you to compare selected emails and find the highest integer value of interest in them using a regular expression; this value is reported in plugin's output
* option to delete or leave selected messages
* option to delete selected messages except the one with the highest value found by capture-max
* plugin output reports elapsed time, number of emails found, value captured (if applicable), and number of emails deleted
* SSL support using IO::Socket::SSL, including verifying server's certificate
* a local search option allows you to download messages and search locally instead of using the IMAP SEARCH command on the server (especially useful for Exchange 2003 admins who suffer from slow indexing times)


Features of check_email_delivery:

* uses separate plugins for email sending and receiving, so you could use alternative plugins to do this work (--plugin option since 0.5)
* does not use any additional database to keep track of which emails were sent or received... out of the box it stamps sent emails with time sent and it uses the capture-max option of the imap plugin to find the most recent email received, and applies threshold to this difference
* can report on the entire email delivery loop or on just one portion of it (--alert option since 0.6)

Features of check_imap_quota:

* displays bytes used, quota limit, and percentage used.

Features of imap_ssl_cert (this is an included utility, not a nagios plugin):

* prints the IMAP server's SSL certificate, which you can save into a file


I use these plugins on my networks so I'm open to suggestions for improvements and to assist you with some difficulties if you use these plugins.

All three plugins are documented with perl POD. Use the --help option to view it.
Reviews (4)
We've used this package to make sure our email environment is delivering messages in a timely fashion. It's a great tool. However, it hasn't been updated in some time.

check_smtp_send depends on Net::SMTP::TLS which is no longer maintained and breaks with new IO::Socket::SSL. That's when you'll see:

invalid SSL_version specified

The fix is to change check_smtp_send to use Net::SMTP which now directly supports STARTTLS.

Patch:

diff --git a/check_smtp_send b/check_smtp_send
index ade0fe3..9be3869 100755
--- a/check_smtp_send
+++ b/check_smtp_send
@@ -85,7 +85,6 @@ if( $smtp_server eq "" && scalar(@mailto) == 1 ) {
my @required_module = ();
push @required_module, 'Net::SMTP::SSL' if $ssl;
push @required_module, ('MIME::Base64','Authen::SASL') if $ssl && $username;
-push @required_module, 'Net::SMTP::TLS' if $tls;
push @required_module, 'Net::SMTP_auth' if $auth_method and not $tls; # whereas if auth_method and tls we use TLS_auth, which is included in this script!
push @required_module, 'Text::Template' if $template;
push @required_module, 'Net::DNS' if $mx_lookup;
@@ -141,7 +140,7 @@ if( $mx_lookup ) {
}

# connect to SMTP server
-# create the smtp handle using Net::SMTP, Net::SMTP::SSL, Net::SMTP::TLS, or an authentication variant
+# create the smtp handle using Net::SMTP, Net::SMTP::SSL, or an authentication variant
my $smtp;
eval {
if( $tls and $auth_method ) {
@@ -154,7 +153,7 @@ eval {
}
elsif( $tls ) {
$smtp_port = $default_smtp_tls_port unless $smtp_port;
- $smtp = Net::SMTP::TLS->new($smtp_server, Timeout=>$timeout, Port=>$smtp_port, User=>$username, Password=>$password);
+ $smtp = Net::SMTP->new($smtp_server, Timeout=>$timeout, Port=>$smtp_port, User=>$username, Password=>$password, starttls=>1);
if( $smtp ) {
my $message = oneline($smtp->message());
die "cannot connect with TLS: $message" if $smtp->code() =~ m/53\d/;
bymaxloi, August 7, 2012
1 of 1 people found this review helpful
The "delivery email" script doesn't not run if you have not installed the "IMAPClient" software, that I'm unable to find into yum.
byTozz, June 4, 2012
2 of 2 people found this review helpful
The plugin itself works just great. There is however a minor issue. In my case the plugin identifies itself to the remote server with ' HELO localhost.localdomain'. My server does not accept this is as part of antispam solution.

The fix is to add "Hello=>'your.nagios.server'" to the new class instance definition:

$smtp = Net::SMTP->new($smtp_server, Port=>$smtp_port, Timeout=>$timeout,Debug=>$smtp_debug, Hello=>'nagios.example.com');
byamaramrahul, February 6, 2012
1 of 1 people found this review helpful
Great plugin. However in check_smtp_send, I noticed a small bug because of which the date timestamp was not being set properly. Here is the fix for it - In check_smtp_send on line 349, change "gmtime" to "localtime". This will set the correct timestamp in the sent mails.