diff options
Diffstat (limited to 'plugins/check_udp.c')
-rw-r--r-- | plugins/check_udp.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/plugins/check_udp.c b/plugins/check_udp.c index 05ade04e..64ab83a7 100644 --- a/plugins/check_udp.c +++ b/plugins/check_udp.c | |||
@@ -14,6 +14,8 @@ | |||
14 | along with this program; if not, write to the Free Software | 14 | along with this program; if not, write to the Free Software |
15 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 15 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
16 | 16 | ||
17 | $Id$ | ||
18 | |||
17 | *****************************************************************************/ | 19 | *****************************************************************************/ |
18 | 20 | ||
19 | const char *progname = "check_udp"; | 21 | const char *progname = "check_udp"; |
@@ -50,7 +52,7 @@ main (int argc, char **argv) | |||
50 | textdomain (PACKAGE); | 52 | textdomain (PACKAGE); |
51 | 53 | ||
52 | if (process_arguments (argc, argv) == ERROR) | 54 | if (process_arguments (argc, argv) == ERROR) |
53 | usage ("\n"); | 55 | usage (_("check_udp: could not parse arguments\n")); |
54 | 56 | ||
55 | /* initialize alarm signal handling */ | 57 | /* initialize alarm signal handling */ |
56 | signal (SIGALRM, socket_timeout_alarm_handler); | 58 | signal (SIGALRM, socket_timeout_alarm_handler); |
@@ -102,7 +104,6 @@ main (int argc, char **argv) | |||
102 | 104 | ||
103 | 105 | ||
104 | 106 | ||
105 | |||
106 | /* process command-line arguments */ | 107 | /* process command-line arguments */ |
107 | int | 108 | int |
108 | process_arguments (int argc, char **argv) | 109 | process_arguments (int argc, char **argv) |
@@ -158,19 +159,19 @@ process_arguments (int argc, char **argv) | |||
158 | break; | 159 | break; |
159 | case 'H': /* hostname */ | 160 | case 'H': /* hostname */ |
160 | if (is_host (optarg) == FALSE) | 161 | if (is_host (optarg) == FALSE) |
161 | usage2 (_("Invalid host name/address"), optarg); | 162 | usage2 (_("Invalid hostname/address"), optarg); |
162 | server_address = optarg; | 163 | server_address = optarg; |
163 | break; | 164 | break; |
164 | case 'c': /* critical */ | 165 | case 'c': /* critical */ |
165 | if (!is_intnonneg (optarg)) | 166 | if (!is_intnonneg (optarg)) |
166 | usage (_("Critical threshold must be a nonnegative integer\n")); | 167 | usage (_("Critical threshold must be a positive integer\n")); |
167 | else | 168 | else |
168 | critical_time = atoi (optarg); | 169 | critical_time = atoi (optarg); |
169 | check_critical_time = TRUE; | 170 | check_critical_time = TRUE; |
170 | break; | 171 | break; |
171 | case 'w': /* warning */ | 172 | case 'w': /* warning */ |
172 | if (!is_intnonneg (optarg)) | 173 | if (!is_intnonneg (optarg)) |
173 | usage (_("Warning threshold must be a nonnegative integer\n")); | 174 | usage (_("Warning threshold must be a positive integer\n")); |
174 | else | 175 | else |
175 | warning_time = atoi (optarg); | 176 | warning_time = atoi (optarg); |
176 | check_warning_time = TRUE; | 177 | check_warning_time = TRUE; |
@@ -183,7 +184,7 @@ process_arguments (int argc, char **argv) | |||
183 | break; | 184 | break; |
184 | case 'p': /* port */ | 185 | case 'p': /* port */ |
185 | if (!is_intnonneg (optarg)) | 186 | if (!is_intnonneg (optarg)) |
186 | usage (_("Server port must be a nonnegative integer\n")); | 187 | usage (_("Port must be a positive integer\n")); |
187 | else | 188 | else |
188 | server_port = atoi (optarg); | 189 | server_port = atoi (optarg); |
189 | break; | 190 | break; |
@@ -199,7 +200,7 @@ process_arguments (int argc, char **argv) | |||
199 | c = optind; | 200 | c = optind; |
200 | if (server_address == NULL && c < argc && argv[c]) { | 201 | if (server_address == NULL && c < argc && argv[c]) { |
201 | if (is_host (argv[c]) == FALSE) | 202 | if (is_host (argv[c]) == FALSE) |
202 | usage2 (_("Invalid host name/address"), optarg); | 203 | usage2 (_("Invalid hostname/address"), optarg); |
203 | server_address = argv[c++]; | 204 | server_address = argv[c++]; |
204 | } | 205 | } |
205 | 206 | ||
@@ -214,9 +215,6 @@ process_arguments (int argc, char **argv) | |||
214 | 215 | ||
215 | 216 | ||
216 | 217 | ||
217 | |||
218 | |||
219 | |||
220 | void | 218 | void |
221 | print_help (void) | 219 | print_help (void) |
222 | { | 220 | { |