diff options
Diffstat (limited to 'plugins/check_udp.c')
| -rw-r--r-- | plugins/check_udp.c | 78 |
1 files changed, 45 insertions, 33 deletions
diff --git a/plugins/check_udp.c b/plugins/check_udp.c index e7d5280c..a712871c 100644 --- a/plugins/check_udp.c +++ b/plugins/check_udp.c | |||
| @@ -1,26 +1,39 @@ | |||
| 1 | /****************************************************************************** | 1 | /****************************************************************************** |
| 2 | 2 | * | |
| 3 | This program is free software; you can redistribute it and/or modify | 3 | * Nagios check_udp 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_udp 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 | const char *progname = "check_udp"; | 34 | const char *progname = "check_udp"; |
| 22 | const char *revision = "$Revision$"; | 35 | const char *revision = "$Revision$"; |
| 23 | const char *copyright = "1999-2004"; | 36 | const char *copyright = "1999-2006"; |
| 24 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; | 37 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; |
| 25 | 38 | ||
| 26 | #include "common.h" | 39 | #include "common.h" |
| @@ -222,8 +235,9 @@ print_help (void) | |||
| 222 | printf ("Copyright (c) 1999 Ethan Galstad\n"); | 235 | printf ("Copyright (c) 1999 Ethan Galstad\n"); |
| 223 | printf (COPYRIGHT, copyright, email); | 236 | printf (COPYRIGHT, copyright, email); |
| 224 | 237 | ||
| 225 | printf (_("\ | 238 | printf ("%s\n", _("This plugin tests an UDP connection with the specified host.")); |
| 226 | This plugin tests an UDP connection with the specified host.\n\n")); | 239 | |
| 240 | printf ("\n\n"); | ||
| 227 | 241 | ||
| 228 | print_usage (); | 242 | print_usage (); |
| 229 | 243 | ||
| @@ -231,11 +245,10 @@ print_help (void) | |||
| 231 | 245 | ||
| 232 | printf (_(UT_HOST_PORT), 'p', "none"); | 246 | printf (_(UT_HOST_PORT), 'p', "none"); |
| 233 | 247 | ||
| 234 | printf (_("\ | 248 | printf (" %s\n", "-e, --expect=STRING <optional>"); |
| 235 | -e, --expect=STRING <optional>\n\ | 249 | printf (" %s\n", _("String to expect in first line of server response")); |
| 236 | String to expect in first line of server response\n\ | 250 | printf (" %s\n", "-s, --send=STRING <optional>"); |
| 237 | -s, --send=STRING <optional>\n\ | 251 | printf (" %s\n", _("String to send to the server when initiating the connection")); |
| 238 | String to send to the server when initiating the connection\n")); | ||
| 239 | 252 | ||
| 240 | printf (_(UT_WARN_CRIT)); | 253 | printf (_(UT_WARN_CRIT)); |
| 241 | 254 | ||
| @@ -243,11 +256,10 @@ print_help (void) | |||
| 243 | 256 | ||
| 244 | printf (_(UT_VERBOSE)); | 257 | printf (_(UT_VERBOSE)); |
| 245 | 258 | ||
| 246 | printf (_("\ | 259 | printf ("%s\n", _("This plugin will attempt to connect to the specified port on the host.")); |
| 247 | This plugin will attempt to connect to the specified port on the host.\n\ | 260 | printf (" %s\n", _("Successful connects return STATE_OK, refusals and timeouts return")); |
| 248 | Successful connects return STATE_OK, refusals and timeouts return\n\ | 261 | printf (" %s\n", _("STATE_CRITICAL, other errors return STATE_UNKNOWN.")); |
| 249 | STATE_CRITICAL, other errors return STATE_UNKNOWN.\n\n")); | 262 | |
| 250 | |||
| 251 | printf(_(UT_SUPPORT)); | 263 | printf(_(UT_SUPPORT)); |
| 252 | } | 264 | } |
| 253 | 265 | ||
| @@ -258,7 +270,7 @@ STATE_CRITICAL, other errors return STATE_UNKNOWN.\n\n")); | |||
| 258 | void | 270 | void |
| 259 | print_usage (void) | 271 | print_usage (void) |
| 260 | { | 272 | { |
| 261 | printf ("\ | 273 | printf (_("Usage:")); |
| 262 | Usage: %s -H <host_address> [-p port] [-w warn_time] [-c crit_time]\n\ | 274 | printf ("%s -H <host_address> [-p port] [-w warn_time] [-c crit_time]\n", progname); |
| 263 | [-e expect] [-s send] [-t to_sec] [-v]\n", progname); | 275 | printf (" [-e expect] [-s send] [-t to_sec] [-v]\n"); |
| 264 | } | 276 | } |
