summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bea6e16)
raw | patch | inline | side by side (parent: bea6e16)
author | Karl DeBisschop <kdebisschop@users.sourceforge.net> | |
Sat, 26 Jul 2003 05:25:59 +0000 (05:25 +0000) | ||
committer | Karl DeBisschop <kdebisschop@users.sourceforge.net> | |
Sat, 26 Jul 2003 05:25:59 +0000 (05:25 +0000) |
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@604 f882894a-f735-0410-b71e-b25c423dba1c
plugins/check_tcp.c | patch | blob | history | |
po/ChangeLog | [new file with mode: 0644] | patch | blob |
diff --git a/plugins/check_tcp.c b/plugins/check_tcp.c
index afb1a681d01da37f2bb75e1b71d03062ae84d185..872a3ccdac4ed68b6a34d2f1b747741833d3e94c 100644 (file)
--- a/plugins/check_tcp.c
+++ b/plugins/check_tcp.c
char *progname = "check_tcp";
const char *revision = "$Revision$";
const char *copyright = "2002-2003";
-const char *authors = "Nagios Plugin Development Team";
const char *email = "nagiosplug-devel@lists.sourceforge.net";
+\f
+
+
+
+void
+print_usage (void)
+{
+ printf (_("\
+Usage: %s -H host -p port [-w <warning time>] [-c <critical time>]\n\
+ [-s <send string>] [-e <expect string>] [-q <quit string>]\n\
+ [-m <maximum bytes>] [-d <delay>] [-t <timeout seconds>]\n\
+ [-r <refuse state>] [-v] [-4|-6]\n"), progname);
+ printf (" %s (-h|--help)\n", progname);
+ printf (" %s (-V|--version)\n", progname);
+}
+
+void
+print_help (void)
+{
+ print_revision (progname, revision);
+
+ printf (_("\
+Copyright (c) %s Nagios Plugin Development Team\n\
+\t<%s>\n\n"),
+ copyright, email);
+
+ printf (_("\
+This plugin tests %s connections with the specified host.\n\n"),
+ SERVICE);
+
+ print_usage ();
+
+ printf (_("\
+\nOptions:\n\
+ -H, --hostname=ADDRESS\n\
+ Host name argument for servers using host headers (use numeric\n\
+ address if possible to bypass DNS lookup).\n\
+ -p, --port=INTEGER\n\
+ Port number\n\
+ -4, --use-ipv4\n\
+ Use IPv4 connection\n\
+ -6, --use-ipv6\n\
+ Use IPv6 connection\n"));
+
+ printf (_("\
+ -s, --send=STRING\n\
+ String to send to the server\n\
+ -e, --expect=STRING\n\
+ String to expect in server response\n\
+ -q, --quit=STRING\n\
+ String to send server to initiate a clean close of the connection\n"));
+
+ printf (_("\
+ -r, --refuse=ok|warn|crit\n\
+ Accept tcp refusals with states ok, warn, crit (default: crit)\n\
+ -m, --maxbytes=INTEGER\n\
+ Close connection once more than this number of bytes are received\n\
+ -d, --delay=INTEGER\n\
+ Seconds to wait between sending string and polling for response\n\
+ -w, --warning=DOUBLE\n\
+ Response time to result in warning status (seconds)\n\
+ -c, --critical=DOUBLE\n\
+ Response time to result in critical status (seconds)\n"));
+
+ printf (_("\
+ -t, --timeout=INTEGER\n\
+ Seconds before connection times out (default: %d)\n\
+ -v, --verbose\n\
+ Show details for command-line debugging (Nagios may truncate output)\n\
+ -h, --help\n\
+ Print detailed help screen\n\
+ -V, --version\n\
+ Print version information\n\n"),
+ DEFAULT_SOCKET_TIMEOUT);
+
+ support ();
+}
+\f
+
int
main (int argc, char **argv)
PORT = 119;
}
else {
- usage ("ERROR: Generic check_tcp called with unknown service\n");
+ usage (_("ERROR: Generic check_tcp called with unknown service\n"));
}
server_address = strdup ("127.0.0.1");
server_quit = QUIT;
if (process_arguments (argc, argv) == ERROR)
- usage ("Could not parse arguments\n");
+ usage (_("Could not parse arguments\n"));
/* use default expect if none listed in process_arguments() */
if (EXPECT && server_expect_count == 0) {
/* return a CRITICAL status if we couldn't read any data */
if (status == NULL)
- terminate (STATE_CRITICAL, "No data received from host\n");
+ terminate (STATE_CRITICAL, _("No data received from host\n"));
strip (status);
if (verbose)
printf ("%d %d\n", i, server_expect_count);
if (i >= server_expect_count)
- terminate (STATE_WARNING, "Invalid response from host\n");
+ terminate (STATE_WARNING, _("Invalid response from host\n"));
if (strstr (status, server_expect[i]))
break;
}
alarm (0);
printf
- ("%s %s%s - %.3f second response time on port %d",
+ (_("%s %s%s - %.3f second response time on port %d"),
SERVICE,
state_text (result),
(was_refused) ? " (refused)" : "",
switch (c) {
case '?': /* print short usage statement if args not parsable */
- printf ("%s: Unknown argument: %s\n\n", progname, optarg);
+ printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
print_usage ();
exit (STATE_UNKNOWN);
case 'h': /* help */
#ifdef USE_IPV6
address_family = AF_INET6;
#else
- usage ("IPv6 support not available\n");
+ usage (_("IPv6 support not available\n"));
#endif
break;
case 'H': /* hostname */
if (is_host (optarg) == FALSE)
- usage2 ("invalid host name or address", optarg);
+ usage2 (_("invalid host name or address"), optarg);
server_address = optarg;
break;
case 'c': /* critical */
if (!is_intnonneg (optarg))
- usage ("Critical threshold must be a nonnegative integer\n");
+ usage (_("Critical threshold must be a nonnegative integer\n"));
critical_time = strtod (optarg, NULL);
check_critical_time = TRUE;
break;
case 'w': /* warning */
if (!is_intnonneg (optarg))
- usage ("Warning threshold must be a nonnegative integer\n");
+ usage (_("Warning threshold must be a nonnegative integer\n"));
warning_time = strtod (optarg, NULL);
check_warning_time = TRUE;
break;
break;
case 't': /* timeout */
if (!is_intpos (optarg))
- usage ("Timeout interval must be a positive integer\n");
+ usage (_("Timeout interval must be a positive integer\n"));
socket_timeout = atoi (optarg);
break;
case 'p': /* port */
if (!is_intpos (optarg))
- usage ("Server port must be a positive integer\n");
+ usage (_("Server port must be a positive integer\n"));
server_port = atoi (optarg);
break;
case 's':
break;
case 'm':
if (!is_intpos (optarg))
- usage ("Maxbytes must be a positive integer\n");
+ usage (_("Maxbytes must be a positive integer\n"));
maxbytes = atoi (optarg);
case 'q':
server_quit = optarg;
else if (!strncmp(optarg,"crit",4))
econn_refuse_state = STATE_CRITICAL;
else
- usage ("Refuse mut be one of ok, warn, crit\n");
+ usage (_("Refuse mut be one of ok, warn, crit\n"));
break;
case 'd':
if (is_intpos (optarg))
delay = atoi (optarg);
else
- usage ("Delay must be a positive integer\n");
+ usage (_("Delay must be a positive integer\n"));
break;
case 'S':
#ifndef HAVE_SSL
terminate (STATE_UNKNOWN,
- "SSL support not available. Install OpenSSL and recompile.");
+ _("SSL support not available. Install OpenSSL and recompile."));
#endif
use_ssl = TRUE;
break;
}
if (server_address == NULL)
- usage ("You must provide a server address\n");
+ usage (_("You must provide a server address\n"));
return OK;
}
\f
-
-
-void
-print_help (void)
-{
- print_revision (progname, revision);
-
- printf ("Copyright (c) %s %s\n\t<%s>\n\n", copyright, authors, email);
-
- printf (_("\
-This plugin tests %s connections with the specified host.\n"), SERVICE);
-
- print_usage ();
-
- printf ("\nOptions:\n");
-
- printf (_("\
- -H, --hostname=ADDRESS\n\
- Host name argument for servers using host headers (use numeric\n\
- address if possible to bypass DNS lookup).\n\
- -p, --port=INTEGER\n\
- Port number\n\
- -4, --use-ipv4\n\
- Use IPv4 connection\n\
- -6, --use-ipv6\n\
- Use IPv6 connection\n"));
-
- printf (_("\
- -s, --send=STRING\n\
- String to send to the server\n\
- -e, --expect=STRING\n\
- String to expect in server response\n\
- -q, --quit=STRING\n\
- String to send server to initiate a clean close of the connection\n"));
-
- printf (_("\
- -r, --refuse=ok|warn|crit\n\
- Accept tcp refusals with states ok, warn, crit (default: crit)\n\
- -m, --maxbytes=INTEGER\n\
- Close connection once more than this number of bytes are received\n\
- -d, --delay=INTEGER\n\
- Seconds to wait between sending string and polling for response\n\
- -w, --warning=DOUBLE\n\
- Response time to result in warning status (seconds)\n\
- -c, --critical=DOUBLE\n\
- Response time to result in critical status (seconds)\n"));
-
- printf (_("\
- -t, --timeout=INTEGER\n\
- Seconds before connection times out (default: %d)\n\
- -v, --verbose\n\
- Show details for command-line debugging (Nagios may truncate output)\n\
- -h, --help\n\
- Print detailed help screen\n\
- -V, --version\n\
- Print version information\n\n"),
- DEFAULT_SOCKET_TIMEOUT);
-
- support ();
-}
-
-void
-print_usage (void)
-{
- printf ("Usage: %s %s\n", progname, _("\
--H host -p port [-w warn_time] [-c crit_time] [-s send_string]\n\
- [-e expect_string] [-q quit_string] [-m maxbytes] [-d delay]\n\
- [-t to_sec] [-r refuse_state] [-v] [-4|-6]\n"));
- printf (" %s (-h|--help)\n", progname);
- printf (" %s (-V|--version)\n", progname);
-}
-\f
-
-
-
#ifdef HAVE_SSL
int
connect_SSL (void)
SSL_load_error_strings ();
if ((ctx = SSL_CTX_new (meth)) == NULL)
{
- printf ("ERROR: Cannot create SSL context.\n");
+ printf (_("ERROR: Cannot create SSL context.\n"));
return STATE_CRITICAL;
}
}
else
{
- printf ("ERROR: Cannot initiate SSL handshake.\n");
+ printf (_("ERROR: Cannot initiate SSL handshake.\n"));
}
SSL_free (ssl);
}
diff --git a/po/ChangeLog b/po/ChangeLog
--- /dev/null
+++ b/po/ChangeLog
@@ -0,0 +1,11 @@
+2003-07-02 gettextize <bug-gnu-gettext@gnu.org>
+
+ * Makefile.in.in: New file, from gettext-0.11.4.
+ * boldquot.sed: New file, from gettext-0.11.4.
+ * en@boldquot.header: New file, from gettext-0.11.4.
+ * en@quot.header: New file, from gettext-0.11.4.
+ * insert-header.sin: New file, from gettext-0.11.4.
+ * quot.sed: New file, from gettext-0.11.4.
+ * remove-potcdate.sin: New file, from gettext-0.11.4.
+ * Rules-quot: New file, from gettext-0.11.4.
+