summaryrefslogtreecommitdiffstats
path: root/plugins/check_real.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/check_real.c')
-rw-r--r--plugins/check_real.c28
1 files changed, 10 insertions, 18 deletions
diff --git a/plugins/check_real.c b/plugins/check_real.c
index 755f6eb..3686ff4 100644
--- a/plugins/check_real.c
+++ b/plugins/check_real.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
19const char *progname = "check_real"; 21const char *progname = "check_real";
@@ -50,9 +52,6 @@ int verbose = FALSE;
50 52
51 53
52 54
53
54
55
56int 55int
57main (int argc, char **argv) 56main (int argc, char **argv)
58{ 57{
@@ -66,7 +65,7 @@ main (int argc, char **argv)
66 textdomain (PACKAGE); 65 textdomain (PACKAGE);
67 66
68 if (process_arguments (argc, argv) != OK) 67 if (process_arguments (argc, argv) != OK)
69 usage (_("Incorrect arguments supplied\n")); 68 usage (_("check_real: could not parse arguments\n"));
70 69
71 /* initialize alarm signal handling */ 70 /* initialize alarm signal handling */
72 signal (SIGALRM, socket_timeout_alarm_handler); 71 signal (SIGALRM, socket_timeout_alarm_handler);
@@ -251,9 +250,6 @@ main (int argc, char **argv)
251 250
252 251
253 252
254
255
256
257/* process command-line arguments */ 253/* process command-line arguments */
258int 254int
259process_arguments (int argc, char **argv) 255process_arguments (int argc, char **argv)
@@ -303,7 +299,7 @@ process_arguments (int argc, char **argv)
303 else if (is_host (optarg)) 299 else if (is_host (optarg))
304 server_address = optarg; 300 server_address = optarg;
305 else 301 else
306 usage2 (_("Invalid host name"), optarg); 302 usage2 (_("Invalid hostname/address"), optarg);
307 break; 303 break;
308 case 'e': /* string to expect in response header */ 304 case 'e': /* string to expect in response header */
309 server_expect = optarg; 305 server_expect = optarg;
@@ -316,7 +312,7 @@ process_arguments (int argc, char **argv)
316 server_port = atoi (optarg); 312 server_port = atoi (optarg);
317 } 313 }
318 else { 314 else {
319 usage (_("Server port must be a positive integer\n")); 315 usage (_("Port must be a positive integer\n"));
320 } 316 }
321 break; 317 break;
322 case 'w': /* warning time threshold */ 318 case 'w': /* warning time threshold */
@@ -325,7 +321,7 @@ process_arguments (int argc, char **argv)
325 check_warning_time = TRUE; 321 check_warning_time = TRUE;
326 } 322 }
327 else { 323 else {
328 usage (_("Warning time must be a nonnegative integer\n")); 324 usage (_("Warning time must be a positive integer\n"));
329 } 325 }
330 break; 326 break;
331 case 'c': /* critical time threshold */ 327 case 'c': /* critical time threshold */
@@ -355,7 +351,9 @@ process_arguments (int argc, char **argv)
355 print_help (); 351 print_help ();
356 exit (STATE_OK); 352 exit (STATE_OK);
357 case '?': /* usage */ 353 case '?': /* usage */
358 usage (_("Invalid argument\n")); 354 printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
355 print_usage ();
356 exit (STATE_UNKNOWN);
359 } 357 }
360 } 358 }
361 359
@@ -365,7 +363,7 @@ process_arguments (int argc, char **argv)
365 server_address = argv[c++]; 363 server_address = argv[c++];
366 } 364 }
367 else { 365 else {
368 usage2 (_("Invalid host name"), argv[c]); 366 usage2 (_("Invalid hostname/address"), argv[c]);
369 } 367 }
370 } 368 }
371 369
@@ -383,8 +381,6 @@ process_arguments (int argc, char **argv)
383 381
384 382
385 383
386
387
388int 384int
389validate_arguments (void) 385validate_arguments (void)
390{ 386{
@@ -393,8 +389,6 @@ validate_arguments (void)
393 389
394 390
395 391
396
397
398void 392void
399print_help (void) 393print_help (void)
400{ 394{
@@ -439,8 +433,6 @@ values."));
439 433
440 434
441 435
442
443
444void 436void
445print_usage (void) 437print_usage (void)
446{ 438{