Commit graph

132 commits

Author SHA1 Message Date
Alexander A. Klimov
f53ea7afd8 check_tcp: add --sni 2020-01-07 21:32:15 +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
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
Sven Nierlein
0be10c669e Merge pull request #1257 from gcoxmoz/master
check_tcp: Fixing to return desired exit code
2015-10-02 19:54:31 +02:00
Andrew Widdersheim
500f8aec81 Readability fix 2015-04-13 14:16:34 +02:00
Sebastian Herbszt
22dfca20fd check_tcp: fix help description regarding escape option
The help description should print '\\' for backslash not just '\'.

Signed-off-by: Sebastian Herbszt <herbszt@gmx.de>
2014-12-01 01:08:58 +01:00
Holger Weiss
013ca2c508 Fix check_jabber to work with Openfire servers
The plugin expected:

	<?xml version='1.0'?>

But Openfire sends:

	<?xml version='1.0' encoding='UTF-8'?>
2014-09-16 12:28:51 +02:00
Greg Cox
4273dd06ff Merge remote-tracking branch 'upstream/master'
Conflicts:
	plugins/netutils.c
2014-07-29 18:52:12 -04:00
Jan Wagner
b62f2c14fb Merge PR #1265 from waja/check_tcp_server_addr 2014-06-30 15:13:39 +02:00
abrist
b5d78f9556 Cleaned up status output of check_tcp changes 2014-06-28 21:08:55 +02:00
Davide Madrisan
4231415878 check_tcp: also display the server addr when host_specified is set. This will help the admins when multiple checks are configured
Signed-off-by: Davide Madrisan <davide.madrisan@gmail.com>
2014-06-28 20:47:51 +02:00
Eric J. Mislivec
6e246799b9 Include common.h before any system headers.
This should fix some problems building on AIX.
2014-06-28 18:09:28 +02:00
gcoxmoz
a3f0b96f32 Update check_tcp.c
Return the state asked for, if connection failed.
2014-05-17 00:55:40 -04: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
Sven Nierlein
cb8390aec9 check_tcp: use receive timeout for checks that expect response
if check_imap expects a string that never occurs, it currently waits forever
because thats how the imap protocoll works. Use a receive timeout in that case
so we can exit early with a proper error message.
2013-09-15 20:49:36 +02:00
Holger Weiss
ffad261eab check_tcp: Fix checks without --expect string
Commit e8044713d4 broke check_tcp checks
without --expect string, this commit fixes that regression.
2013-09-12 22:36:35 +02:00
Holger Weiss
e8044713d4 check_tcp: Properly deal will partial recv(3)s
The np_expect_match() function now returns one of three possible states
instead of just TRUE or FALSE:

- NP_MATCH_SUCCESS
- NP_MATCH_FAILURE
- NP_MATCH_RETRY

The NP_MATCH_RETRY state indicates that matching might succeed if
np_expect_match() is called with a longer input string.  This allows
check_tcp to decide whether it makes sense to wait for additional data
from the server.
2013-09-12 21:37:20 +02:00
Holger Weiss
662997251d Improve interface of np_expect_match() function
Replace the three boolean parameters of lib/utils_tcp.c's
np_expect_match() function with a single "flags" parameter.
2013-09-12 17:42:10 +02:00
Holger Weiss
b48cb1f130 Fix GCC's -Wimplicit-function-declaration warnings
Fix the issues found by GCC when the -Wimplicit-function-declaration
flag is specified.
2013-09-10 22:29:46 +02:00
juliopedreira
cfb50add53 check_tcp: Don't close connection too early
Closing the connection because the bytes received are less than the
buffer size assumes that all the bytes will be received in one go.  This
is not always true!
2013-09-10 12:16:46 +02:00
Sven Nierlein
5fce5ceaeb check_tcp: don't ignore trailing options
"./check_tcp -6 -p 80 host" leads to an error:
TCP CRITICAL - Invalid hostname, address or socket: 127.0.0.1
because 127.0.0.1 is the fallback host, the tailing hostname
was ignored.
2013-02-10 23:09:49 +01:00
William Leibzon
6b844aea9f fixing bug in certificate experiation patch checking for bad warning threshold data 2012-08-10 13:03:00 +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
Holger Weiss
cbc8a7f313 check_tcp: Print performance data even with -D
When using the 1.4.15 release of the Nagios Plugins, a command such as

  check_tcp -H pop.example.com -p 995 -D 14

usually produced two lines of output, e.g.:

  OK - Certificate will expire on 12/13/2014 23:59.
  TCP OK - 0.009 second response time on port 995|time=0.008849s;;;0.000000;10.000000

The second line was removed by 4d06603060.
However, as the old two-line output is a valid (though in this case
unintended) way to spit out performance data, removing the second line
might break current setups.  Therefore, we revert to the old behaviour,
at least for the moment.

The issue was reported by Jochen Bern on the "nagiosplug-devel" mailing
list (Message-ID: <4FEAE812.8030309@LINworks.de>).
2012-06-27 17:29: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
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
Ton Voon
5324544855 Typo fixes (Jan Wagner - SF 1878971) 2009-02-20 00:00:13 +00: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
dac9d73736 Fix check_tcp longoptions handling
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2072 f882894a-f735-0410-b71e-b25c423dba1c
2008-11-05 21:36:43 +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
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
Ton Voon
31a58a1535 Reverted commit 1879 where an invalid hostname returns UNKNOWN - back to CRITICAL
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1900 f882894a-f735-0410-b71e-b25c423dba1c
2008-01-08 11:51:53 +00:00
Ton Voon
65e066acfa check_tcp now returns UNKNOWN with an invalid hostname on command line
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1879 f882894a-f735-0410-b71e-b25c423dba1c
2007-12-19 10:08:06 +00:00
Matthias Eble
d059eeb294 Moved check_tcp's expect string testing into utils_tcp for testing purposes.
Added -A/--all flag to test for every expect string passed.


git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1729 f882894a-f735-0410-b71e-b25c423dba1c
2007-06-03 14:40:13 +00:00
Matthias Eble
716ff400f0 Fix segfault when -e is specified multiple times. Thanks to John Rouillard and Ralph Roessner (#1475899)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1723 f882894a-f735-0410-b71e-b25c423dba1c
2007-05-29 20:01:26 +00:00
Matthias Eble
1e2982f072 No more warn/crit values in performance data if -w and -c are not specified.
Thanks to Simon Bellwood (#1181554)


git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1722 f882894a-f735-0410-b71e-b25c423dba1c
2007-05-29 19:11:42 +00:00
Ton Voon
7106d10ab2 Documentation fix re: --escape flag. Fix of ./check_tcp test to webservers
to make it more standards compliant


git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1620 f882894a-f735-0410-b71e-b25c423dba1c
2007-02-14 10:11:07 +00:00
Thomas Guyot-Sionnest
8572a59254 Correct vim typo in comment block :P
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1612 f882894a-f735-0410-b71e-b25c423dba1c
2007-02-06 23:30:54 +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
Thomas Guyot-Sionnest
b0307d7a99 Fix progname being partly set to upper case
Change formating of invalid hostname output


git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1604 f882894a-f735-0410-b71e-b25c423dba1c
2007-02-01 06:53:12 +00:00
Thomas Guyot-Sionnest
e0a4206cdd Fix Debian Bug #392610: check_jabber always return warning
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1599 f882894a-f735-0410-b71e-b25c423dba1c
2007-01-31 04:47:30 +00:00
Thomas Guyot-Sionnest
f9c189e946 Jail does not requires any arguments
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1598 f882894a-f735-0410-b71e-b25c423dba1c
2007-01-30 14:24:10 +00:00
Thomas Guyot-Sionnest
e8a3864bca Fix reporting bug using expect, affecting (not fixing) Debian bug #392610: check_jabber always return warning
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1596 f882894a-f735-0410-b71e-b25c423dba1c
2007-01-30 05:01:00 +00:00