Commit graph

104 commits

Author SHA1 Message Date
Geert Hendrickx
0bd45c200b
check_smtp: add -L flag to support LMTP (LHLO instead of HELO/EHLO). 2021-10-28 23:08:02 +02:00
Iustin Pop
8520c643dd Simply initializes n before it is used
When SSL is enabled, n is assigned the size of the server's second EHLO
response (I think in bytes), which will usually be significantly higher
than the command passed. As such, no commands are executed and no responses
are checked, which - silently - defeats the desired checks and results in a
success value.
2019-01-18 22:52:54 +01:00
Jan Wagner
dbb92c347e Spelling fixes suggested by lintian 2016-12-01 12:49:40 +01:00
Oliver Skibbe
6438fec788 Merge pull request #1382 from riskersen/smtp_tls_expec
check_smtp: extended support for expect option
2016-11-19 16:38:07 +01:00
Holger Weiss
303acfc64f Merge remote-tracking branch 'monitoring-plugins/pr/1443'
* monitoring-plugins/pr/1443:
  add openssl 1.1 support
2016-11-18 11:51:12 +01:00
Holger Weiss
487a9d0a8b check_radius: Replace functions removed in radcli
The radcli library no longer offers the rc_get_ipaddr(),
rc_good_ipaddr(), and rc_own_ipaddress() functions.
2016-11-17 17:22:37 +01:00
vagrant
fe1c4bb0e5 add openssl 1.1 support
changes:
  - CRYPTO_lock detection replaced in configure.ac. We don't use that
    function anywhere, so just replace it with the suggested one from
    https://wiki.openssl.org/index.php/Library_Initialization#Autoconf
  - OPENSSL_NO_SSL2 is no longer defined while ssl2 is not included.
    Set it ourself using the suggested openssl 1.1 version check from
    https://wiki.openssl.org/index.php/1.1_API_Changes#Backward_compatibility
  - openssl 1.1 sends a sigpipe if the connection is still open when
    calling SSL_shutdown(), so move the close before the shutdown.

Signed-off-by: Sven Nierlein <sven@nierlein.de>
2016-11-13 21:14:02 +00:00
Oliver Skibbe
6b8c0bdf11 check_smtp: extended support for expect option
expect option (-e) supported only first response, so checking for
  any other response like 250-xxx would never match. This fix stores
  return of relevant buffer

  closes #1381
2015-10-08 11:09:25 +02:00
Oliver Skibbe
b6de2341f8 check_smtp.c: modified SSL check for use with -e
- currently STARTTLS check does not work with -e if there's text
    like '220 hostname ESMTP*'. This is caused by SMTP answer from
    host. Postfix answer: 220 2.0.0 Ready to start TLS, Exchange
    2010: 220 2.0.0 SMTP server ready. This fix checks against 220

    closes #1093
2015-10-08 09:04:29 +02:00
Holger Weiss
dfe66c01c0 check_smtp: Let "-D" option imply "-S" 2015-10-06 23:28:24 +02:00
Holger Weiss
b317aaf32a check_smtp: QUIT SMTP connection when "-D" is used
Don't forget to issue an SMTP QUIT command when the -D/--certificate
option is specified.  This avoids undesired MTA log messages.
2015-10-06 23:21:17 +02:00
Sven Nierlein
edca257e20 use unknown exit code for help/version in plugins
Signed-off-by: Sven Nierlein <sven@nierlein.de>
2015-10-04 19:24:30 +02:00
Thomas Guyot-Sionnest
11cf54ca78 Merge branch 'rename' 2014-01-21 07:59:07 -05:00
Spenser Reinhardt
212575b858 plugins/*.c: Alterations for timeout messages.
.c file changes for misleading timeout messages in help functions. Solution to pull request #1209 tracker by awiddersheim.

Files: plugins/check_apt.c, plugins/check_by_ssh.c, plugins/check_dbi.c, plugins/check_dig.c, plugins/check_disk.c, plugins/check_dns.c, plugins/check_game.c, plugins/check_http.c, plugins/check_ldap.c, plugins/check_ntp.c, plugins/check_ntp_peer.c, plugins/check_ntp_time.c, plugins/check_nwstat.c, plugins/check_overcr.c, plugins/check_pgsql.c, plugins/check_ping.c, plugins/check_procs.c, plugins/check_radius.c, plugins/check_real.c, plugins/check_smtp.c, plugins/check_snmp.c, plugins/check_ssh.c, plugins/check_tcp.c, plugins/check_time.c, plugins/check_ups.c, plugins/negate.c
2014-01-21 11:33:45 +01:00
Holger Weiss
c3e756a855 Capitalize "Monitoring" when it's the first word 2014-01-20 03:12:50 +01:00
Monitoring Plugins Development Team
63734f52ab Project rename initial commit.
This is an initial take at renaming the project to Monitoring Plugins.
It's not expected to be fully complete, and it is expected to break
things (The perl module for instance). More testing will be required
before this goes mainline.
2014-01-19 14:18:47 -05:00
Jan Wagner
b6f0e755fd Fixed SF.net bug 2555775, threshold can be double for check_smtp
Thanks to Roman Fiedler for reporting the issue and providing a fix
2013-08-06 10:55:49 +02:00
William Leibzon
6b844aea9f fixing bug in certificate experiation patch checking for bad warning threshold data 2012-08-10 13:03:00 +02:00
Eric Stanley
49df5964eb Re-added missing variable declarations to check_smtp.c
A recent update removed the declarations for a couple variables in
check_smtp.c that are still being used, which caused a failure
in the compilation of check_smtp.c. This commit restores those variable
declarations so the check_smtp.c will again compile.
2012-07-04 12:48:07 -05:00
Holger Weiss
b57aeb1e5f check_smtp: Remove a comment regarding MAIL FROM
Earlier versions of check_smtp generated an (invalid) "MAIL FROM"
command without arguments by default.  These days, a "MAIL FROM" command
is only sent if the --from option is specified.

This commit removes a comment which explains the old behaviour, and it
updates a variable name accordingly.
2012-06-29 15:09:34 +02:00
Holger Weiss
973d147cef check_smtp: Fix help and usage output regarding -R 2012-06-29 14:25:40 +02:00
Anders Kaseorg
638b596992 check_smtp: Fix strcat overflows
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2012-06-29 13:39:11 +02:00
Anders Kaseorg
028d50d6f9 Die when asprintf fails
Fixes many instances of
warning: ignoring return value of 'asprintf', declared with attribute warn_unused_result [-Wunused-result]

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2012-06-29 13:39:11 +02:00
Anders Kaseorg
9976876584 check_smtp: Strip angle brackets from -f argument, if provided
Apparently some people used -f '<nagios@example.com>' to work around
the bug I just fixed in the MAIL FROM: command generation.  Although
the resulting command wasn't RFC-compliant, it was working with some
MTAs, so let's continue to support this syntax now that we generate
RFC-compliant commands.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2012-06-29 13:39:11 +02:00
Anders Kaseorg
dd1e9eb5ea check_smtp: Change MAIL FROM: command to comply with the SMTP standard
Every version of the SMTP standard (from RFC 821 to the current RFC
5321) requires the address following MAIL FROM: to follow the colon
immediately (with no space) and to be surrounded by angle brackets.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2012-06-29 13:39:11 +02:00
William Leibzon
fa3d2a4074 applied patch that adds both critical and warning thresholds to certificate expiration checks of check_tcp, check_http, check_smtp 2012-06-25 12:05:16 +02:00
Ton Voon
4d06603060 Fix check_smtp and check_tcp where duplicate messages were displayed for certificate errors (Opsview team) 2011-07-15 21:19:15 +01:00
Ton Voon
e7f6da0211 New option to check_smtp to ignore failures when sending QUIT (#3358348 - Duncan Ferguson) 2011-07-15 16:48:45 +01:00
Holger Weiss
d16f3fb0a9 check_smtp: Abort on missing/unexpected greeting
Abort immediately if we don't receive a server greeting or if the
greeting doesn't contain the "--expect"ed string (by default: "220")
instead of blindly sending the EHLO/HELO line.

Spotted by Daniel Piddock, see Debian bug report #611914.
2011-02-08 17:07:52 +01:00
Thomas Guyot-Sionnest
4b42d5aff4 Add missing --fqdn help (Jan Wagner) 2010-05-08 17:41:14 -04:00
Thomas Guyot-Sionnest
eaf3cb27f4 Add newline after "Usage:" in --help 2010-04-22 08:57:14 -04:00
Thomas Guyot-Sionnest
884aee0667 Standardize the extra-opts notes 2010-04-21 23:29:18 -04:00
Thomas Guyot-Sionnest
25d1ee331d Fix translations when extra-opts aren't enabled
Bug #2832884 reported problem with translations outputting pot file
headers. This is caused by "" matching the header of the translation
files.

This patch moves gettext macros inside utils macros and update some
french translations.
2010-04-14 08:33:06 -04:00
Matthias Eble
6f0665719c Removed -n option in check_smtp's help and usage output (#2782784)
Check_smtp's help showed the -n/--nocommand options to not send an
SMTP command. This usage is covered by check_tcp and is thus not needed
in check_smtp.
2009-05-22 20:17:50 +02:00
Thomas Guyot-Sionnest
6fbd14fea5 Removing CVS/SVN tags and replacing with git-based versioning
For contrib/, full tags have been imported from subversion


git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2091 f882894a-f735-0410-b71e-b25c423dba1c
2008-11-23 05:38:47 +00:00
Thomas Guyot-Sionnest
caa8bd6423 Bulk EOL cleanup
$ git diff --ignore-space-change|diffstat
 0 files changed


git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2087 f882894a-f735-0410-b71e-b25c423dba1c
2008-11-19 06:45:18 +00:00
Thomas Guyot-Sionnest
44f8455b2c Added support for --extra-opts in all C plugins (disabled by default, see configure --help)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1991 f882894a-f735-0410-b71e-b25c423dba1c
2008-05-07 10:02:42 +00:00
Matthias Eble
082c32f972 Enhanced check_smtp to actually print invalid response text (#1911239)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1942 f882894a-f735-0410-b71e-b25c423dba1c
2008-03-14 22:35:29 +00:00
Ton Voon
dc2ec71d22 Fixed link -m64 problems on pst3 for solaris. Fixed _FILE_OFFSET_BITS
redefinition warnings. Fixed helper ar error in ./configure


git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1938 f882894a-f735-0410-b71e-b25c423dba1c
2008-03-11 00:10:23 +00:00
Thomas Guyot-Sionnest
abbad00edd Import Gnulib floorf and base64 and removed our old base64 library.
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1926 f882894a-f735-0410-b71e-b25c423dba1c
2008-02-12 12:03:58 +00:00
Thomas Guyot-Sionnest
6c4468a728 Bump plugin/ to GPLv3 (check_overcr to check_users)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1917 f882894a-f735-0410-b71e-b25c423dba1c
2008-01-31 10:44:26 +00:00
Thomas Guyot-Sionnest
7a05ad0166 Moved base64 function to /lib.
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1817 f882894a-f735-0410-b71e-b25c423dba1c
2007-11-09 21:17:03 +00:00
Holger Weiss
05a980ba4b Properly handle SMTP server responses which are split into multiple
packets (noted by Chris Adams on nagiosplug-help@).  TODO: The new
recvline()/recvlines() functions should buffer received data instead of
reading one byte at a time and they should be moved to netutils.c so
that other plugins can use them, too.


git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1780 f882894a-f735-0410-b71e-b25c423dba1c
2007-09-15 14:25:56 +00:00
Holger Weiss
0616123167 Read the response to an SMTP QUIT command before closing the socket
(noted by Dieter Hendricks on nagiosplug-help@)


git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1769 f882894a-f735-0410-b71e-b25c423dba1c
2007-07-31 14:47:04 +00:00
Matthias Eble
c134205981 Fixed segfault in argument processing. Thanks to Christoph Schell (#1742066)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1757 f882894a-f735-0410-b71e-b25c423dba1c
2007-07-14 19:36:48 +00:00
Ton Voon
cf2ba0769c Fixed compile errors in check_smtp.c
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1631 f882894a-f735-0410-b71e-b25c423dba1c
2007-03-06 22:29:27 +00:00
Ton Voon
1db33136b0 Fixed broken HELO cmd (Enrico Scholz - 1675279)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1630 f882894a-f735-0410-b71e-b25c423dba1c
2007-03-06 22:17:04 +00:00
Benoit Mortier
19b97afb12 correcting some translation problems
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1611 f882894a-f735-0410-b71e-b25c423dba1c
2007-02-06 21:03:21 +00:00
Holger Weiss
fd329a1e91 Don't try to print `optarg' (which will be a NULL pointer) if an unknown
command line option was used, as this leads to a segfault on some
systems.  The unknown option will be printed by getopt(3) anyway.  So,
simply call print_usage() and exit UNKNOWN via the new usage5() instead.


git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1590 f882894a-f735-0410-b71e-b25c423dba1c
2007-01-28 21:46:41 +00:00
Ton Voon
fe856aa957 Sync with gnulib - lots of extraneous code removed in preference to GNU code
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1580 f882894a-f735-0410-b71e-b25c423dba1c
2007-01-24 22:47:25 +00:00