summaryrefslogtreecommitdiffstats
path: root/plugins/check_tcp.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/check_tcp.c')
-rw-r--r--plugins/check_tcp.c110
1 files changed, 59 insertions, 51 deletions
diff --git a/plugins/check_tcp.c b/plugins/check_tcp.c
index bbb8d11..00105f9 100644
--- a/plugins/check_tcp.c
+++ b/plugins/check_tcp.c
@@ -1,27 +1,40 @@
1/***************************************************************************** 1/*****************************************************************************
2 2*
3 This program is free software; you can redistribute it and/or modify 3* Nagios check_tcp plugin
4 it under the terms of the GNU General Public License as published by 4*
5 the Free Software Foundation; either version 2 of the License, or 5* License: GPL
6 (at your option) any later version. 6* Copyright (c) 1999-2006 nagios-plugins team
7 7*
8 This program is distributed in the hope that it will be useful, 8* Last Modified: $Date$
9 but WITHOUT ANY WARRANTY; without even the implied warranty of 9*
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10* Description:
11 GNU General Public License for more details. 11*
12 12* This file contains the check_tcp plugin
13 You should have received a copy of the GNU General Public License 13*
14 along with this program; if not, write to the Free Software 14* License Information:
15 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 15*
16 16* This program is free software; you can redistribute it and/or modify
17 $Id$ 17* it under the terms of the GNU General Public License as published by
18 18* the Free Software Foundation; either version 2 of the License, or
19* (at your option) any later version.
20*
21* This program is distributed in the hope that it will be useful,
22* but WITHOUT ANY WARRANTY; without even the implied warranty of
23* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24* GNU General Public License for more details.
25*
26* You should have received a copy of the GNU General Public License
27* along with this program; if not, write to the Free Software
28* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
29*
30* $Id$
31*
19*****************************************************************************/ 32*****************************************************************************/
20 33
21/* progname "check_tcp" changes depending on symlink called */ 34/* progname "check_tcp" changes depending on symlink called */
22char *progname; 35char *progname;
23const char *revision = "$Revision$"; 36const char *revision = "$Revision$";
24const char *copyright = "1999-2004"; 37const char *copyright = "1999-2006";
25const char *email = "nagiosplug-devel@lists.sourceforge.net"; 38const char *email = "nagiosplug-devel@lists.sourceforge.net";
26 39
27#include "common.h" 40#include "common.h"
@@ -589,35 +602,31 @@ print_help (void)
589 602
590 printf (_(UT_IPv46)); 603 printf (_(UT_IPv46));
591 604
592 printf (_("\ 605 printf (" %s\n", "-E, --escape");
593 -E, --escape\n\ 606 printf (" %s\n", _("Can use \\n, \\r, \\t or \\ in send or quit string."));
594 Can use \\n, \\r, \\t or \\ in send or quit string.\n\ 607 printf (" %s\n", _("Default: nothing added to send, \\r\\n added to end of quit"));
595 Default: nothing added to send, \\r\\n added to end of quit\n\ 608 printf (" %s\n", "-s, --send=STRING");
596 -s, --send=STRING\n\ 609 printf (" %s\n", _("String to send to the server"));
597 String to send to the server\n\ 610 printf (" %s\n", "-e, --expect=STRING");
598 -e, --expect=STRING\n\ 611 printf (" %s\n", _("String to expect in server response"));
599 String to expect in server response\n\ 612 printf (" %s\n", "-q, --quit=STRING");
600 -q, --quit=STRING\n\ 613 printf (" %s\n", _("String to send server to initiate a clean close of the connection"));
601 String to send server to initiate a clean close of the connection\n")); 614 printf (" %s\n", "-r, --refuse=ok|warn|crit");
602 615 printf (" %s\n", _("Accept tcp refusals with states ok, warn, crit (default: crit)"));
603 printf (_("\ 616 printf (" %s\n", "-M, --mismatch=ok|warn|crit");
604 -r, --refuse=ok|warn|crit\n\ 617 printf (" %s\n", _("Accept expected string mismatches with states ok, warn, crit (default: warn)"));
605 Accept tcp refusals with states ok, warn, crit (default: crit)\n\ 618 printf (" %s\n", "-j, --jail");
606 -M, --mismatch=ok|warn|crit\n\ 619 printf (" %s\n", _("Hide output from TCP socket"));
607 Accept expected string mismatches with states ok, warn, crit (default: warn)\n\ 620 printf (" %s\n", "-m, --maxbytes=INTEGER");
608 -j, --jail\n\ 621 printf (" %s\n", _("Close connection once more than this number of bytes are received"));
609 Hide output from TCP socket\n\ 622 printf (" %s\n", "-d, --delay=INTEGER");
610 -m, --maxbytes=INTEGER\n\ 623 printf (" %s\n", _("Seconds to wait between sending string and polling for response"));
611 Close connection once more than this number of bytes are received\n\
612 -d, --delay=INTEGER\n\
613 Seconds to wait between sending string and polling for response\n"));
614 624
615#ifdef HAVE_SSL 625#ifdef HAVE_SSL
616 printf (_("\ 626 printf (" %s\n", "-D, --certificate=INTEGER");
617 -D, --certificate=INTEGER\n\ 627 printf (" %s\n", _("Minimum number of days a certificate has to be valid."));
618 Minimum number of days a certificate has to be valid.\n\ 628 printf (" %s\n", "-S, --ssl");
619 -S, --ssl\n\ 629 printf (" %s\n", _("Use SSL for the connection."));
620 Use SSL for the connection.\n"));
621#endif 630#endif
622 631
623 printf (_(UT_WARN_CRIT)); 632 printf (_(UT_WARN_CRIT));
@@ -633,11 +642,10 @@ print_help (void)
633void 642void
634print_usage (void) 643print_usage (void)
635{ 644{
636 printf ("\ 645 printf (_("Usage:"));
637Usage: %s -H host -p port [-w <warning time>] [-c <critical time>]\n\ 646 printf ("%s -H host -p port [-w <warning time>] [-c <critical time>] [-s <send string>]\n",progname);
638 [-s <send string>] [-e <expect string>] [-q <quit string>]\n\ 647 printf ("[-e <expect string>] [-q <quit string>][-m <maximum bytes>] [-d <delay>]\n");
639 [-m <maximum bytes>] [-d <delay>] [-t <timeout seconds>]\n\ 648 printf ("[-t <timeout seconds>] [-r <refuse state>] [-M <mismatch state>] [-v] [-4|-6] [-j]\n");
640 [-r <refuse state>] [-M <mismatch state>] [-v] [-4|-6] [-j]\n\ 649 printf ("[-D <days to cert expiry>] [-S <use SSL>] [-E]\n");
641 [-D <days to cert expiry>] [-S <use SSL>] [-E]\n", progname);
642} 650}
643 651