summaryrefslogtreecommitdiffstats
path: root/plugins/check_tcp.c
AgeCommit message (Collapse)AuthorFilesLines
2012-06-29Die when asprintf failsAnders Kaseorg1-2/+2
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-27check_tcp: Print performance data even with -DHolger Weiss1-1/+1
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 4d06603060fc1233861b164870f0d3a2e0d8d2eb. 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-25applied patch that adds both critical and warning thresholds to certificate ↵William Leibzon1-6/+21
expiration checks of check_tcp, check_http, check_smtp
2011-07-15Fix check_smtp and check_tcp where duplicate messages were displayed for ↵Ton Voon1-4/+1
certificate errors (Opsview team)
2010-04-22Add newline after "Usage:" in --helpThomas Guyot-Sionnest1-1/+1
2010-04-22Standardize the extra-opts notesThomas Guyot-Sionnest1-6/+0
2010-04-14Fix translations when extra-opts aren't enabledThomas Guyot-Sionnest1-9/+9
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.
2009-02-20Typo fixes (Jan Wagner - SF 1878971)Ton Voon1-1/+1
2008-11-23Removing CVS/SVN tags and replacing with git-based versioningThomas Guyot-Sionnest1-5/+2
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-19Bulk EOL cleanupThomas Guyot-Sionnest1-2/+2
$ 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-05Fix check_tcp longoptions handlingThomas Guyot-Sionnest1-5/+3
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2072 f882894a-f735-0410-b71e-b25c423dba1c
2008-05-07Added support for --extra-opts in all C plugins (disabled by default, see ↵Thomas Guyot-Sionnest1-0/+10
configure --help) git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1991 f882894a-f735-0410-b71e-b25c423dba1c
2008-01-31Bump plugin/ to GPLv3 (check_overcr to check_users)Thomas Guyot-Sionnest1-17/+15
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1917 f882894a-f735-0410-b71e-b25c423dba1c
2008-01-08Reverted commit 1879 where an invalid hostname returns UNKNOWN - back to ↵Ton Voon1-1/+1
CRITICAL git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1900 f882894a-f735-0410-b71e-b25c423dba1c
2007-12-19check_tcp now returns UNKNOWN with an invalid hostname on command lineTon Voon1-1/+1
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1879 f882894a-f735-0410-b71e-b25c423dba1c
2007-06-03Moved check_tcp's expect string testing into utils_tcp for testing purposes.Matthias Eble1-24/+23
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-05-29Fix segfault when -e is specified multiple times. Thanks to John Rouillard ↵Matthias Eble1-2/+1
and Ralph Roessner (#1475899) git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1723 f882894a-f735-0410-b71e-b25c423dba1c
2007-05-29No more warn/crit values in performance data if -w and -c are not specified.Matthias Eble1-4/+4
Thanks to Simon Bellwood (#1181554) git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1722 f882894a-f735-0410-b71e-b25c423dba1c
2007-02-14Documentation fix re: --escape flag. Fix of ./check_tcp test to webserversTon Voon1-1/+1
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-06Correct vim typo in comment block :PThomas Guyot-Sionnest1-1/+1
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1612 f882894a-f735-0410-b71e-b25c423dba1c
2007-02-06correcting some translation problemsBenoit Mortier1-1/+1
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1611 f882894a-f735-0410-b71e-b25c423dba1c
2007-02-01Fix progname being partly set to upper caseThomas Guyot-Sionnest1-2/+2
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-01-31Fix Debian Bug #392610: check_jabber always return warningThomas Guyot-Sionnest1-2/+2
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1599 f882894a-f735-0410-b71e-b25c423dba1c
2007-01-30Jail does not requires any argumentsThomas Guyot-Sionnest1-1/+1
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1598 f882894a-f735-0410-b71e-b25c423dba1c
2007-01-30Fix reporting bug using expect, affecting (not fixing) Debian bug #392610: ↵Thomas Guyot-Sionnest1-8/+18
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-28Don't try to print `optarg' (which will be a NULL pointer) if an unknownHolger Weiss1-1/+1
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-23Add missing `break' to the switch-case block that handles the `-m' optionHolger Weiss1-0/+1
(Nobuhiro Ban - 1642682) git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1577 f882894a-f735-0410-b71e-b25c423dba1c
2006-10-19another round of localization cleaningBenoit Mortier1-51/+59
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1509 f882894a-f735-0410-b71e-b25c423dba1c
2006-09-02- fix for warning/critical timeouts in check_tcp.c, in which the pluginM. Sean Finney1-10/+4
would exit with a usage error if non-int timeouts were passed. - change --warning-time/--critical-time to just --warning/--critical, as it's what --help says. git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1473 f882894a-f735-0410-b71e-b25c423dba1c
2006-03-29New function to for escaped strings from command line for send/quit.Ton Voon1-32/+23
Adapted from Sebastian Wiesinger's patch (1292404) git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1365 f882894a-f735-0410-b71e-b25c423dba1c
2006-03-24udp checks require and send and receive option. Tests updated so ifTon Voon1-1/+5
nc is available, will check send and receive working correctly git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1353 f882894a-f735-0410-b71e-b25c423dba1c
2006-03-22Options to change line ends for -s and -q (John Rouillard - 1346104)Ton Voon1-4/+33
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1344 f882894a-f735-0410-b71e-b25c423dba1c
2006-03-21Return CRITICAL if hostname invalid, as per guidelinesTon Voon1-1/+1
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1335 f882894a-f735-0410-b71e-b25c423dba1c
2005-11-04Fixed --mismatch option for check_tcp. Added tests into check_imapTon Voon1-1/+1
(Rick Fey - 1339134) git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1273 f882894a-f735-0410-b71e-b25c423dba1c
2005-10-31code cleanups, largely resulting from turning on -Wall. mostlyM. Sean Finney1-5/+3
unused variables and explicit casting issues, but there were a couple gotchas in there too. git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1267 f882894a-f735-0410-b71e-b25c423dba1c
2005-10-30another fix from alex: check for '/' in the server_address beforeM. Sean Finney1-1/+1
trying to resolve it via is_host(). git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1265 f882894a-f735-0410-b71e-b25c423dba1c
2005-10-30fixes for some bugs found in my merging of the tcp socket patchM. Sean Finney1-3/+3
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1264 f882894a-f735-0410-b71e-b25c423dba1c
2005-10-25- added code to allow check_tcp (via np_net_connect) work with localM. Sean Finney1-7/+17
unix sockets. some testing would be welcome. based on idea from Alex Samorukov. - also introduced a check_clamd behavior in check_tcp. git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1261 f882894a-f735-0410-b71e-b25c423dba1c
2005-10-19all plugins now using centralized ssl functions in netutils.cM. Sean Finney1-106/+6
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1257 f882894a-f735-0410-b71e-b25c423dba1c
2005-10-19- initial attempt at consolidating ssl-related code into netutils.{c,h}M. Sean Finney1-115/+30
- added some #ifdefs to common.h and netutils.h to prevent multiple inclusions (as netlibs now includes common.h) - all ssl plugins (tcp/http/smtp) compile cleanly against gnutls, though certificate checking still needs to be done. - modified configure script so you can also explicitly say "without-gnutls" too (otherwise if you disable openssl you have no way of disabling gnutls too) git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1255 f882894a-f735-0410-b71e-b25c423dba1c
2005-10-18initial "experimental" support for gnutls. by default openssl is stillM. Sean Finney1-14/+28
used if available, and gnutls is only used if openssl is not available or explicitly disabled (--without-openssl). currently the only plugin i've verified to work is check_tcp, but i had to disable cert checking. git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1254 f882894a-f735-0410-b71e-b25c423dba1c
2005-06-05check_tcp code cleanup from andreas plus fix to andreas' patch from seanM. Sean Finney1-276/+242
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1189 f882894a-f735-0410-b71e-b25c423dba1c
2005-05-25bah, my_connect is taken by mysql. now calling it np_net_connect.M. Sean Finney1-1/+1
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1176 f882894a-f735-0410-b71e-b25c423dba1c
2005-05-24optimizations and cleanup from andreasM. Sean Finney1-24/+14
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1173 f882894a-f735-0410-b71e-b25c423dba1c
2005-05-03if check_tcp was called with -e but not -s, it would hang in a call to ↵M. Sean Finney1-2/+4
my_recv. the fix committed here adds on more piece of logic to the check to see if more data needs to be read, avoiding the deadlock call. a better fix would be to not use these "voodoo" heuristics and instead use poll() or select(), but that's quite a bit more complicated. git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1170 f882894a-f735-0410-b71e-b25c423dba1c
2005-04-11this should add support for check_ssmtp, based on the 1.3.x patch in 1155562,M. Sean Finney1-0/+10
but fixed to follow how things are done in 1.4 (using strdup instead of asprintf) and patching configure.in instead of configure. git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1159 f882894a-f735-0410-b71e-b25c423dba1c
2004-12-30more internationalization fixesBenoit Mortier1-1/+1
internationalization freeze for beta1 git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1067 f882894a-f735-0410-b71e-b25c423dba1c
2004-12-25various fixes for localizationBenoit Mortier1-16/+14
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1061 f882894a-f735-0410-b71e-b25c423dba1c
2004-12-11Patch from Ollie Cook to define return code when expected value not received ↵Matthew Kent1-8/+28
(#1082275). Also included another change from Ollie Cook to do stricter matching of expected values from the beginning of the line. When a user defines an expected string this is changed to the old style strstr matching. git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1025 f882894a-f735-0410-b71e-b25c423dba1c
2004-12-08patch 1028033Benoit Mortier1-1/+1
minor internationalization fixes git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1013 f882894a-f735-0410-b71e-b25c423dba1c