CHECK_E...ELIVERY(7)
π CHECK_EMAIL_DELIVERY β the check_email_delivery manual page, bestie edition π
okay so. this is the user-contributed perl documentation for check_email_delivery, and honestly? it's giving "my whole job is sending an email and then making sure it actually arrived." no cap. it's the girl who texts you and then double-texts you to confirm you got it. iconic behavior fr fr.
β¨ NAME β¨
check_email_delivery β sends email and verifies delivery πβ¨
like, it literally sends a message and then goes and checks that the message showed up. that's the whole vibe.
πΈ SYNOPSIS πΈ
check_email_delivery -vV
check_email_delivery --usage
check_email_delivery --help
π OPTIONS π
okay bestie, buckle up, because there are a LOT of these and they all matter. every single one. periodt.
--warning <seconds>[,<smtp_seconds>,<imap_seconds>]β exits with WARNING if the most recent email found is older than<seconds>. the optional<smtp_seconds>and<imap_seconds>parameters get passed on to the included plugins that handle those tasks. if you don't give them, they just won't be passed on and the default for that plugin applies. also known as:-w <seconds>[,<send>[,<recv>]]
when you're using the --plugin option, only one parameter is supported (-w <seconds>) and it applies to the entire process. you can specify a warning threshold specific to each plugin in the plugin command line instead.
when you're using the --plugin option, no measuring of "most recent email" happens, because we literally would not know how to read that info from receive plugins. this may be addressed in future versions. (the way that's a future problem and not a me problem π
)
--critical <seconds>[,<smtp_seconds>,<imap_seconds>]β exits with CRITICAL if the most recent email found is older than<seconds>. the optional<smtp_seconds>and<imap_seconds>parameters get passed on to the included plugins used for those tasks. if you don't give them, they won't be passed on and the default for that plugin applies. also known as:-c <seconds>[,<send>[,<recv>]]
when using the --plugin option, only one parameter is supported (-c <seconds>) and it applies to the entire process. you can specify a critical threshold specific to each plugin in the plugin command line.
when using the --plugin option, no measuring of "most recent email" is done, because we would not know how to read this information from receive plugins. this may be addressed in future versions.
--timeout <seconds>--timeout <smtp_seconds>,<imap_seconds>--timeout <plugin1_seconds>,<plugin2_seconds>,...β exits with CRITICAL if the plugins don't return a status within the specified number of seconds. when only one parameter is used, it applies to each plugin. when multiple parameters are used (separated by commas), they apply to plugins in the same order the plugins were specified on the command line. when using--timeoutbut NOT the--pluginoption, the first parameter is forcheck_smtp_sendand the second is forcheck_imap_receive.--alert <pluginN>β exits with WARNING or CRITICAL only if a warning or error (--warning,--critical, or--timeout) occurs for the specified plugins. if a warning or error occurs for non-specified plugins that run BEFORE the specified plugins, the exit status will be UNKNOWN. if a warning or error occurs for non-specified plugins that run AFTER the specified plugins, the exit status will not be affected.
you'd use this option if you're using check_email_delivery with the --plugin option and the plugins you configure each use different servers, for example different SMTP and IMAP servers. by default, if you don't use the --alert option, if anything goes wrong during the email delivery check, a WARNING or CRITICAL alert will be issued. this means that if you define check_email_delivery for the SMTP server only and the IMAP server fails, Nagios will alert you for the SMTP server, which would be misleading. if you define it for both the SMTP server and IMAP server and just one of them fails, Nagios will alert you for both servers, which would still be misleading. if you have this situation, you may want to use the --alert option. you define the check_email_delivery check for both servers: for the SMTP server (first plugin) you use --alert 1, and for the IMAP server (second plugin) you use --alert 2. when check_email_delivery runs with --alert 1 and the SMTP server fails, you will get the appropriate alert. if the IMAP server fails it will not affect the status. when check_email_delivery runs with --alert 2 and the SMTP server fails, you will get the UNKNOWN return code. if the IMAP server generates an alert you will get a WARNING or CRITICAL as appropriate.
you can repeat this option to specify multiple plugins that should cause an alert. do this if you have multiple plugins on the command line but some of them involve the same server.
see also: --plugin. also known as: -A <pluginN>
--wait <seconds>[,<seconds>,...]β how long to wait between sending the message and checking that it was received. view default with the-vVoption.
when using the --plugin option, you can specify as many wait-between times as you have plugins (minus the last plugin, because it makes no sense to wait after running the last one). for example, if you use the --plugin option twice to specify an SMTP plugin and an IMAP plugin, and you want to wait 5 seconds between sending and receiving, then you would specify --wait 5. a second example: if you are using the --plugin option three times, then specifying -w 5 will wait 5 seconds between the second and third plugins also. you can specify a different wait time of 10 seconds between the second and third plugins, like this: -w 5,10.
--hostname <server>β address or name of the SMTP and IMAP server. examples:mail.server.com,localhost,192.168.1.100. also known as:-H <server>--smtp-server <server>β address or name of the SMTP server. examples:smtp.server.com,localhost,192.168.1.100. using this option overrides the hostname option.--smtp-port <number>β service port on the SMTP server. default is25.--smtp-username <username>--smtp-password <password>β username and password to use when connecting to the SMTP server with the TLS option. use these options if the SMTP account has a different username/password than the IMAP account you are testing. these options take precedence over the--usernameand the--passwordoptions.
these are shell-escaped; special characters are ok.
--imap-server <server>β address or name of the IMAP server. examples:imap.server.com,localhost,192.168.1.100. using this option overrides the hostname option.--imap-port <number>β service port on the IMAP server. default is143. if you use SSL the default is993.--imap-username <username>--imap-password <password>β username and password to use when connecting to the IMAP server. use these options if the IMAP account has a different username/password than the SMTP account you are testing. these options take precedence over the--usernameand the--passwordoptions.
these are shell-escaped; special characters are ok.
--username <username>--password <password>β username and password to use when connecting to IMAP server. also known as:-U <username>-P <password>
also used as the username and password for SMTP when the TLS option is enabled. to specify a separate set of credentials for SMTP authentication, see the options --smtp-username and --smtp-password.
--imap-check-interval <seconds>β how long to wait between polls of the imap-server for the specified mail. default is5seconds.--imap-retries <times>β how many times to poll the imap-server for the mail, before we give up. default is10.--body <message>β use this option to specify the body of the email message.--header <header>β use this option to set an arbitrary header in the message. you can use it multiple times.--mailto recipient@your.netβ you can send a message to multiple recipients by repeating this option or by separating the email addresses with commas (no whitespace allowed):
$ check_email_delivery ... --mailto recipient@your.net,recipient2@your.net --mailfrom sender@your.net
this argument is shell-escaped; special characters or angle brackets around the address are ok.
--mailfrom sender@your.netβ use this option to set the "from" address in the email.--imapssl =item --noimapsslβ use this to enable or disable SSL for the IMAP plugin.
this argument is shell-escaped; special characters or angle brackets around the address are ok.
--smtptls =item --nosmtptlsβ use this to enable or disable TLS/AUTH for the SMTP plugin.--libexecβ use this option to set the path of the Nagios libexec directory. the default is/usr/local/nagios/libexec. this is where this plugin looks for the SMTP and IMAP plugins that it depends on.--plugin <command>β this is a new option introduced in version0.5of thecheck_email_deliveryplugin. it frees the plugin from depending on specific external plugins and generalizes the work done to determine that the email loop is operational. when using the--pluginoption, the following options are ignored:libexec,imapssl,smtptls,hostname,username,password,smtp*,imap*,mailto,mailfrom,body,header,search.
use this option multiple times to specify the complete trip. typically, you would use this twice to specify plugins for SMTP and IMAP, or SMTP and POP3.
the output will be success if all the plugins return success. each plugin should be a standard Nagios plugin.
a random token will be automatically generated and passed to each plugin specified on the command line by substituting the string %TOKEN1%.
example usage:
command_name check_email_delivery
command_line check_email_delivery
--plugin "$USER1$/check_smtp_send -H $ARG1$ --mailto recipient@your.net --mailfrom sender@your.net --header 'Subject: Nagios Test %TOKEN1%.'"
--plugin "$USER1$/check_imap_receive -H $ARG1$ -U $ARG1$ -P $ARG2$ -s SUBJECT -s 'Nagios Test %TOKEN1%.'"
this technique allows for a lot of flexibility in configuring the plugins that test each part of your email delivery loop.
see also: --token. also known as: -p <command>
--token <format>β this is a new option introduced in version0.5of thecheck_email_deliveryplugin. it can be used in conjunction with--pluginto control the tokens that are generated and passed to the plugins, like%TOKEN1%.
okay bestie, that's part one down and we are SO not done yet β more coming, don't go anywhere π
Use this option multiple times to specify formats for different tokens. Like, if you want %TOKEN1% to consist of only alphabetical characters but want %TOKEN2% to consist of only digits, then you might use these options: --token aaaaaa --token nnnnn β¨
Any tokens used in your plugin commands that have not been specified by --token <format> will default to --token U-X-Y
Token formats, bestie:
aβ alpha character (a-z)nβ numeric character (0-9)cβ alphanumeric character (a-z0-9)hβ hexadecimal character (0-9a-f)Uβ unix time, seconds from epoch. eg1193012441Xβ a word from the pgp even list. egaardvarkYβ a word from the pgp odd list. egadroitness
Caution: It has been observed that some IMAP servers do not handle underscores well in the search criteria. For best results, avoid using underscores in your tokens. Use hyphens or commas instead. π
See also: --plugin. Also known as: -T <format>
The PGP word list was obtained from http://en.wikipedia.org/wiki/PGP_word_list
--file <file>β Save (append) status information into the given tab-delimited file. Format used:
token start-time end-time status plugin-num output
Note: format may change in future versions and may become configurable.
This option available as of version 0.6.2.
Also known as: -F <file>
--hiresβ Use theTime::HiResmodule to measure time, if available.--verboseβ Display additional information. Useful for troubleshooting. Use together with--versionto see the default warning and critical timeout values. Also known as:-v--versionβ Display plugin version and exit. Also known as:-V--helpβ Display this documentation and exit. Does not work in the ePN version. Also known as:-h--usageβ Display a short usage instruction and exit.
β¨ EXAMPLES β¨
π Send a message with custom headers
$ check_email_delivery -H mail.server.net --mailto recipient@your.net --mailfrom sender@your.net --username recipient --password secret
EMAIL DELIVERY OK - 1 seconds
β° Set warning and critical timeouts for receive plugin only:
$ check_email_delivery -H mail.server.net --mailto recipient@your.net --mailfrom sender@your.net --username recipient --password secret -w ,,5 -c ,,15
EMAIL DELIVERY OK - 1 seconds
π¦ EXIT CODES π¦
Complies with the Nagios plug-in specification:
- 0 β OK: The plugin was able to check the service and it appeared to be functioning properly
- 1 β Warning: The plugin was able to check the service, but it appeared to be above some "warning" threshold or did not appear to be working properly
- 2 β Critical: The plugin detected that either the service was not running or it was above some "critical" threshold
- 3 β Unknown: Invalid command line arguments were supplied to the plugin or the plugin was unable to check the status of the given hosts/service
π NAGIOS PLUGIN NOTES π
Nagios plugin reference: http://nagiosplug.sourceforge.net/developer-guidelines.html
This plugin does NOT use Nagios DEFAULT_SOCKET_TIMEOUT (provided by utils.pm as $TIMEOUT) because the path to utils.pm must be specified completely in this program and forces users to edit the source code if their install location is different (if they realize this is the problem). You can view the default timeout for this module by using the --verbose and --version options together. The short form is -vV.
Other than that, it attempts to follow published guidelines for Nagios plugins.
π CHANGES π
- Wed Oct 29 13:08:00 PST 2005
- + version 0.1
- Wed Nov 9 17:16:09 PST 2005
- + updated arguments to
check_smtp_sendandcheck_imap_receive - + added
eval/alarmblock to implement-coption - + added
waitoption to adjust sleep time between smtp and imap calls - + added
delay-warnanddelay-critoptions to adjust email delivery warning thresholds - + now using an inline
PluginReportpackage to generate the report - + copyright notice and GNU GPL
- + version 0.2
- + updated arguments to
- Thu Apr 20 14:00:00 CET 2006 (by Johan Nilsson <johann (at) axis.com>)
- + version 0.2.1
- + corrected bug in getoptions (
$imap_serverwould never ever be set from command-line...) - + will not make
$smtp_serverand$imap_server==$hostif they're defined on commandline - + added support for multiple polls of imap-server, with specified intervals
- + changed default behaviour in
check_imap_server(searches for the specific id in subject and deletes mails found) - + increased default
delay_warnfrom 65 seconds to 95 seconds
- Thu Apr 20 16:00:00 PST 2006 (by Geoff Crompton <geoff.crompton@strategicdata.com.au>)
- + fixed a bug in getoptions
- + version 0.2.2
- Tue Apr 24 21:17:53 PDT 2007
- + now there is an alternate version (same but without embedded perl POD) that is compatible with the new new embedded-perl Nagios feature
- + version 0.2.3
- Fri Apr 27 20:32:53 PDT 2007
- + documentation now mentions every command-line option accepted by the plugin, including abbreviations
- + changed connection error to display timeout only if timeout was the error
- + default IMAP plugin is
libexec/check_imap_receive(also checking for same but with.plextension) - + default SMTP plugin is
libexec/check_smtp_send(also checking for same but with.plextension) - + removed default values for SMTP port and IMAP port to allow those plugins to set the defaults; so current behavior stays the same and will continue to make sense with SSL
- + version 0.3
- Thu Oct 11 10:00:00 EET 2007 (by Timo Virtaneva <timo (at) virtaneva dot com>
- + Changed the header and the search criteria so that the same email-box can be used for all smtp-servers
- + version 0.3.1
- Sun Oct 21 11:01:03 PDT 2007
- + added support for TLS options to the SMTP plugin
- + version 0.4
- Sun Oct 21 16:17:14 PDT 2007
- + added support for arbitrary plugins to send and receive mail (or anthing else!). see the
--pluginoption. - + version 0.5
- + added support for arbitrary plugins to send and receive mail (or anthing else!). see the
- Tue Dec 4 07:36:20 PST 2007
- + added
--usageoption because the official nagios plugins have both--helpand--usage - + added
--timeoutoption to match the official nagios plugins - + shortcut option for
--tokenis now-Tto avoid clash with standard shortcut-tfor--timeout - + fixed some minor pod formatting issues for perldoc
- + version 0.5.1
- + added
- Sat Dec 15 07:39:59 PST 2007
- + improved compatibility with Nagios embedded perl (ePN)
- + version 0.5.2
- Thu Jan 17 20:27:36 PST 2008 (by Timo Virtaneva <timo (at) virtaneva dot com> on Thu Oct 11 10:00:00 EET 2007)
- + Changed the header and the search criteria so that the same email-box can be used for all smtp-servers
- + version 0.5.3
- Mon Jan 28 22:11:02 PST 2008
- + fixed a bug, smtp-password and imap-password are now string parameters
- + added
--alertoption to allow selection of which plugin(s) should cause a WARNING or CRITICAL alert - + version 0.6
- Mon Feb 11 19:09:37 PST 2008
- + fixed a bug for embedded perl version, variable
%statuswill not stay shared inload_modules - + version 0.6.1
- + fixed a bug for embedded perl version, variable
- Mon May 26 10:39:19 PDT 2008
- + added
--fileoption to allow plugin to record status information into a tab-delimited file - + changed default token from
U_X_YtoU-X-Y - + version 0.6.2
- + added
- Wed Jan 14 08:29:35 PST 2009
- + fixed a bug that the
--headerparameter was not being passed to the smtp plugin. - + version 0.6.3
- + fixed a bug that the
- Mon Jun 8 15:43:48 PDT 2009
- + added performance data for use with PNP4Nagios! (thanks to Ben Ritcey for the patch)
- + version 0.6.4
- Wed Sep 16 07:10:10 PDT 2009
- + added elapsed time in seconds to performance data
- + version 0.6.5
- Fri Oct 8 19:48:44 PDT 2010
- + fixed uniform IMAP and SMTP username and password bug (thanks to Micle Moerenhout for pointing it out)
- + version 0.6.6
- Mon Jan 3 08:24:23 PST 2011
- + added shell escaping for smtp-username, smtp-password, mailto, mailfrom, imap-username, and imap-password arguments
- + version 0.7.0
- Fri May 6 08:35:09 AST 2011
- + added
--hiresoption to enable use ofTime::Hiresif available - + version 0.7.1
- + added
- Sun Jun 12 17:17:06 AST 2011
- + added
--imap-mailboxoption to pass through tocheck_imap_receive --mailboxoption - + added
--ssloption to conveniently enable both--smtp-tlsand--imap-ssl - + version 0.7.2
- + added
π AUTHOR π
Jonathan Buhacoff <jonathan@buhacoff.net>
π COPYRIGHT AND LICENSE π
Copyright (C) 2005-2011 Jonathan Buhacoff
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
http://www.gnu.org/licenses/gpl.txt
This page is from perl v5.40.1, dated 2026-02-11, and it's the CHECK_E...ELIVERY(7) man page. Bye bestie, slay! πβ¨π¦
π¦ where this page comes from
- ubuntu resolute: monitoring-plugins-contrib 48.20250420ubuntu3
- ubuntu stonking: monitoring-plugins-contrib 48.20250420ubuntu3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms