summaryrefslogtreecommitdiffstats
path: root/plugins/t
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/t')
0 files changed, 0 insertions, 0 deletions
diff --git a/plugins/check_dig.c b/plugins/check_dig.c
index a44d578..c607896 100644
--- a/plugins/check_dig.c
+++ b/plugins/check_dig.c
@@ -81,9 +81,9 @@ main (int argc, char **argv)
81 if (verbose) { 81 if (verbose) {
82 printf ("%s\n", command_line); 82 printf ("%s\n", command_line);
83 if(expected_address != NULL) { 83 if(expected_address != NULL) {
84 printf ("Looking for: '%s'\n", expected_address); 84 printf (_("Looking for: '%s'\n"), expected_address);
85 } else { 85 } else {
86 printf ("Looking for: '%s'\n", query_address); 86 printf (_("Looking for: '%s'\n"), query_address);
87 } 87 }
88 } 88 }
89 89
@@ -214,9 +214,7 @@ process_arguments (int argc, char **argv)
214 214
215 switch (c) { 215 switch (c) {
216 case '?': /* help */ 216 case '?': /* help */
217 printf (_("%s: Unknown argument: %s\n\n"), progname, optarg); 217 usage2 (_("Unknown argument"), optarg);
218 print_usage ();
219 exit (STATE_UNKNOWN);
220 case 'h': /* help */ 218 case 'h': /* help */
221 print_help (); 219 print_help ();
222 exit (STATE_OK); 220 exit (STATE_OK);
diff --git a/plugins/check_disk.c b/plugins/check_disk.c
index 669a1cd..ab9f66f 100644
--- a/plugins/check_disk.c
+++ b/plugins/check_disk.c
@@ -438,9 +438,7 @@ process_arguments (int argc, char **argv)
438 print_help (); 438 print_help ();
439 exit (STATE_OK); 439 exit (STATE_OK);
440 case '?': /* help */ 440 case '?': /* help */
441 printf (_("%s: Unknown argument: %s\n\n"), progname, optarg); 441 usage2 (_("Unknown argument"), optarg);
442 print_usage ();
443 exit (STATE_UNKNOWN);
444 } 442 }
445 } 443 }
446 444
@@ -488,7 +486,7 @@ print_path (const char *mypath)
488 if (mypath == NULL) 486 if (mypath == NULL)
489 printf ("\n"); 487 printf ("\n");
490 else 488 else
491 printf (" for %s\n", mypath); 489 printf (_(" for %s\n"), mypath);
492 490
493 return; 491 return;
494} 492}
diff --git a/plugins/check_dns.c b/plugins/check_dns.c
index 20cb6dd..e6483b9 100644
--- a/plugins/check_dns.c
+++ b/plugins/check_dns.c
@@ -135,7 +135,7 @@ main (int argc, char **argv)
135 asprintf(&address, "%s,%s", address, temp_buffer); 135 asprintf(&address, "%s,%s", address, temp_buffer);
136 } 136 }
137 137
138 else if (strstr (input_buffer, "Non-authoritative answer:")) { 138 else if (strstr (input_buffer, _("Non-authoritative answer:"))) {
139 non_authoritative = TRUE; 139 non_authoritative = TRUE;
140 } 140 }
141 141
@@ -277,7 +277,6 @@ error_scan (char *input_buffer)
277} 277}
278 278
279 279
280
281/* process command-line arguments */ 280/* process command-line arguments */
282int 281int
283process_arguments (int argc, char **argv) 282process_arguments (int argc, char **argv)
@@ -313,9 +312,7 @@ process_arguments (int argc, char **argv)
313 312
314 switch (c) { 313 switch (c) {
315 case '?': /* args not parsable */ 314 case '?': /* args not parsable */
316 printf (_("%s: Unknown argument: %s\n\n"), progname, optarg); 315 usage2 (_("Unknown argument"), optarg);
317 print_usage ();
318 exit (STATE_UNKNOWN);
319 case 'h': /* help */ 316 case 'h': /* help */
320 print_help (); 317 print_help ();
321 exit (STATE_OK); 318 exit (STATE_OK);
@@ -386,7 +383,6 @@ process_arguments (int argc, char **argv)
386} 383}
387 384
388 385
389
390int 386int
391validate_arguments () 387validate_arguments ()
392{ 388{
@@ -397,7 +393,6 @@ validate_arguments ()
397} 393}
398 394
399 395
400
401void 396void
402print_help (void) 397print_help (void)
403{ 398{
@@ -432,7 +427,6 @@ specified in /etc/resolv.conf will be used.\n\n"));
432} 427}
433 428
434 429
435
436void 430void
437print_usage (void) 431print_usage (void)
438{ 432{
diff --git a/plugins/check_dummy.c b/plugins/check_dummy.c
index 2dbbaec..0892611 100644
--- a/plugins/check_dummy.c
+++ b/plugins/check_dummy.c
@@ -30,7 +30,6 @@ void print_help (void);
30void print_usage (void); 30void print_usage (void);
31 31
32 32
33
34int 33int
35main (int argc, char **argv) 34main (int argc, char **argv)
36{ 35{
diff --git a/plugins/check_fping.c b/plugins/check_fping.c
index 7f05d4d..5ffcd16 100644
--- a/plugins/check_fping.c
+++ b/plugins/check_fping.c
@@ -242,9 +242,7 @@ process_arguments (int argc, char **argv)
242 242
243 switch (c) { 243 switch (c) {
244 case '?': /* print short usage statement if args not parsable */ 244 case '?': /* print short usage statement if args not parsable */
245 printf (_("%s: Unknown argument: %s\n\n"), progname, optarg); 245 usage2 (_("Unknown argument"), optarg);
246 print_usage ();
247 exit (STATE_UNKNOWN);
248 case 'h': /* help */ 246 case 'h': /* help */
249 print_help (); 247 print_help ();
250 exit (STATE_OK); 248 exit (STATE_OK);
@@ -301,15 +299,13 @@ process_arguments (int argc, char **argv)
301 } 299 }
302 } 300 }
303 301
304
305 if (server_name == NULL) 302 if (server_name == NULL)
306 usage (_("Hostname was not supplied\n\n")); 303 usage4 (_("Hostname was not supplied"));
307 304
308 return OK; 305 return OK;
309} 306}
310 307
311 308
312
313int 309int
314get_threshold (char *arg, char *rv[2]) 310get_threshold (char *arg, char *rv[2])
315{ 311{
@@ -351,7 +347,6 @@ get_threshold (char *arg, char *rv[2])
351} 347}
352 348
353 349
354
355void 350void
356print_help (void) 351print_help (void)
357{ 352{
@@ -395,7 +390,6 @@ percentage of packet loss to trigger an alarm state.\n"));
395} 390}
396 391
397 392
398
399void 393void
400print_usage (void) 394print_usage (void)
401{ 395{
diff --git a/plugins/check_game.c b/plugins/check_game.c
index 6699c71..05b363a 100644
--- a/plugins/check_game.c
+++ b/plugins/check_game.c
@@ -123,15 +123,15 @@ main (int argc, char **argv)
123 } 123 }
124 124
125 if (strstr (ret[2], QSTAT_HOST_ERROR)) { 125 if (strstr (ret[2], QSTAT_HOST_ERROR)) {
126 printf ("CRITICAL - Host not found\n"); 126 printf (_("CRITICAL - Host not found\n"));
127 result = STATE_CRITICAL; 127 result = STATE_CRITICAL;
128 } 128 }
129 else if (strstr (ret[2], QSTAT_HOST_DOWN)) { 129 else if (strstr (ret[2], QSTAT_HOST_DOWN)) {
130 printf ("CRITICAL - Game server down or unavailable\n"); 130 printf (_("CRITICAL - Game server down or unavailable\n"));
131 result = STATE_CRITICAL; 131 result = STATE_CRITICAL;
132 } 132 }
133 else if (strstr (ret[2], QSTAT_HOST_TIMEOUT)) { 133 else if (strstr (ret[2], QSTAT_HOST_TIMEOUT)) {
134 printf ("CRITICAL - Game server timeout\n"); 134 printf (_("CRITICAL - Game server timeout\n"));
135 result = STATE_CRITICAL; 135 result = STATE_CRITICAL;
136 } 136 }
137 else { 137 else {
@@ -156,7 +156,6 @@ main (int argc, char **argv)
156} 156}
157 157
158 158
159
160int 159int
161process_arguments (int argc, char **argv) 160process_arguments (int argc, char **argv)
162{ 161{
@@ -199,9 +198,7 @@ process_arguments (int argc, char **argv)
199 198
200 switch (c) { 199 switch (c) {
201 case '?': /* args not parsable */ 200 case '?': /* args not parsable */
202 printf (_("%s: Unknown argument: %s\n\n"), progname, optarg); 201 usage2 (_("Unknown argument"), optarg);
203 print_usage ();
204 exit (STATE_UNKNOWN);
205 case 'h': /* help */ 202 case 'h': /* help */
206 print_help (); 203 print_help ();
207 exit (STATE_OK); 204 exit (STATE_OK);
@@ -269,6 +266,7 @@ process_arguments (int argc, char **argv)
269 return validate_arguments (); 266 return validate_arguments ();
270} 267}
271 268
269
272int 270int
273validate_arguments (void) 271validate_arguments (void)
274{ 272{
@@ -291,9 +289,6 @@ validate_arguments (void)
291} 289}
292 290
293 291
294
295
296
297void 292void
298print_help (void) 293print_help (void)
299{ 294{
diff --git a/plugins/check_hpjd.c b/plugins/check_hpjd.c
index 5376956..dd49893 100644
--- a/plugins/check_hpjd.c
+++ b/plugins/check_hpjd.c
@@ -286,7 +286,6 @@ main (int argc, char **argv)
286} 286}
287 287
288 288
289
290/* process command-line arguments */ 289/* process command-line arguments */
291int 290int
292process_arguments (int argc, char **argv) 291process_arguments (int argc, char **argv)
@@ -334,9 +333,7 @@ process_arguments (int argc, char **argv)
334 print_help (); 333 print_help ();
335 exit (STATE_OK); 334 exit (STATE_OK);
336 case '?': /* help */ 335 case '?': /* help */
337 printf (_("%s: Unknown argument: %s\n\n"), progname, optarg); 336 usage2 (_("Unknown argument"), optarg);
338 print_usage ();
339 exit (STATE_UNKNOWN);
340 } 337 }
341 } 338 }
342 339
@@ -361,7 +358,6 @@ process_arguments (int argc, char **argv)
361} 358}
362 359
363 360
364
365int 361int
366validate_arguments (void) 362validate_arguments (void)
367{ 363{
@@ -369,7 +365,6 @@ validate_arguments (void)
369} 365}
370 366
371 367
372
373void 368void
374print_help (void) 369print_help (void)
375{ 370{
diff --git a/plugins/check_icmp.c b/plugins/check_icmp.c
index cbd6864..4571682 100644
--- a/plugins/check_icmp.c
+++ b/plugins/check_icmp.c
@@ -310,19 +310,19 @@ int main(int argc, char **argv)
310 310
311 /* check if we are root */ 311 /* check if we are root */
312 if(geteuid()) { 312 if(geteuid()) {
313 printf("Root access needed (for raw sockets)\n"); 313 printf(_("Root access needed (for raw sockets)\n"));
314 exit(STATE_UNKNOWN); 314 exit(STATE_UNKNOWN);
315 } 315 }
316 316
317 /* confirm that ICMP is available on this machine */ 317 /* confirm that ICMP is available on this machine */
318 if((proto = getprotobyname("icmp")) == NULL) 318 if((proto = getprotobyname("icmp")) == NULL)
319 crash("icmp: unknown protocol"); 319 crash(_("icmp: unknown protocol"));
320 320
321 /* create raw socket for ICMP calls (ping) */ 321 /* create raw socket for ICMP calls (ping) */
322 sock = socket(AF_INET, SOCK_RAW, proto->p_proto); 322 sock = socket(AF_INET, SOCK_RAW, proto->p_proto);
323 323
324 if(sock < 0) 324 if(sock < 0)
325 crash("can't create raw socket"); 325 crash(_("Can't create raw socket"));
326 326
327 /* drop privileges now that we have the socket */ 327 /* drop privileges now that we have the socket */
328 if((uid = getuid())) { 328 if((uid = getuid())) {
@@ -334,7 +334,7 @@ int main(int argc, char **argv)
334 ident = getpid() & 0xFFFF; 334 ident = getpid() & 0xFFFF;
335 335
336 if(!(host_base_ptr = malloc(sizeof(struct host_name_list)))) { 336 if(!(host_base_ptr = malloc(sizeof(struct host_name_list)))) {
337 crash("Unable to allocate memory for host name list\n"); 337 crash(_("Unable to allocate memory for host name list\n"));
338 } 338 }
339 host_ptr = host_base_ptr; 339 host_ptr = host_base_ptr;
340 340
@@ -359,12 +359,12 @@ int main(int argc, char **argv)
359 switch (c) { 359 switch (c) {
360 case 'H': 360 case 'H':
361 if(!(host_ptr->entry = malloc(strlen(optarg) + 1))) { 361 if(!(host_ptr->entry = malloc(strlen(optarg) + 1))) {
362 crash("Failed to allocate memory for hostname"); 362 crash(_("Failed to allocate memory for hostname"));
363 } 363 }
364 memset(host_ptr->entry, 0, strlen(optarg) + 1); 364 memset(host_ptr->entry, 0, strlen(optarg) + 1);
365 host_ptr->entry = memcpy(host_ptr->entry, optarg, strlen(optarg)); 365 host_ptr->entry = memcpy(host_ptr->entry, optarg, strlen(optarg));
366 if(!(host_ptr->next = malloc(sizeof(struct host_name_list)))) 366 if(!(host_ptr->next = malloc(sizeof(struct host_name_list))))
367 crash("Failed to allocate memory for hostname"); 367 crash(_("Failed to allocate memory for hostname"));
368 host_ptr = host_ptr->next; 368 host_ptr = host_ptr->next;
369 host_ptr->next = NULL; 369 host_ptr->next = NULL;
370// add_name(optarg); 370// add_name(optarg);
@@ -375,35 +375,35 @@ int main(int argc, char **argv)
375 break; 375 break;
376 case 'w': 376 case 'w':
377 if(get_threshold(optarg, &warn)) { 377 if(get_threshold(optarg, &warn)) {
378 printf("Illegal threshold pair specified for -%c", c); 378 printf(_("Illegal threshold pair specified for -%c"), c);
379 print_usage(); 379 print_usage();
380 } 380 }
381 break; 381 break;
382 382
383 case 'c': 383 case 'c':
384 if(get_threshold(optarg, &crit)) { 384 if(get_threshold(optarg, &crit)) {
385 printf("Illegal threshold pair specified for -%c", c); 385 printf(_("Illegal threshold pair specified for -%c"), c);
386 print_usage(); 386 print_usage();
387 } 387 }
388 break; 388 break;
389 389
390 case 't': 390 case 't':
391 if(!(timeout = (u_int) strtoul(optarg, NULL, 0) * 100)) { 391 if(!(timeout = (u_int) strtoul(optarg, NULL, 0) * 100)) {
392 printf("option -%c requires integer argument\n", c); 392 printf(_("Option -%c requires integer argument\n"), c);
393 print_usage(); 393 print_usage();
394 } 394 }
395 break; 395 break;
396 396
397 case 'r': 397 case 'r':
398 if(!(retry = (u_int) strtoul(optarg, NULL, 0))) { 398 if(!(retry = (u_int) strtoul(optarg, NULL, 0))) {
399 printf("option -%c requires integer argument\n", c); 399 printf(_("Option -%c requires integer argument\n"), c);
400 print_usage(); 400 print_usage();
401 } 401 }
402 break; 402 break;
403 403
404 case 'i': 404 case 'i':
405 if(!(interval = (u_int) strtoul(optarg, NULL, 0) * 100)) { 405 if(!(interval = (u_int) strtoul(optarg, NULL, 0) * 100)) {
406 printf("option -%c requires positive non-zero integer argument\n", c); 406 printf(_("Option -%c requires positive non-zero integer argument\n"), c);
407 print_usage(); 407 print_usage();
408 } 408 }
409 break; 409 break;
@@ -411,14 +411,14 @@ int main(int argc, char **argv)
411 case 'p': 411 case 'p':
412 case 'n': 412 case 'n':
413 if(!(count = (u_int) strtoul(optarg, NULL, 0))) { 413 if(!(count = (u_int) strtoul(optarg, NULL, 0))) {
414 printf("option -%c requires positive non-zero integer argument\n", c); 414 printf(_("Option -%c requires positive non-zero integer argument\n"), c);
415 print_usage(); 415 print_usage();
416 } 416 }
417 break; 417 break;
418 418
419 case 'b': 419 case 'b':
420 if(!(ping_data_size = (u_int) strtoul(optarg, NULL, 0))) { 420 if(!(ping_data_size = (u_int) strtoul(optarg, NULL, 0))) {
421 printf("option -%c requires integer argument\n", c); 421 printf(_("Option -%c requires integer argument\n"), c);
422 print_usage(); 422 print_usage();
423 } 423 }
424 break; 424 break;
@@ -467,7 +467,7 @@ int main(int argc, char **argv)
467 break; 467 break;
468 468
469 default: 469 default:
470 printf("option flag -%c specified, but not recognized\n", c); 470 printf(_("Option flag -%c specified, but not recognized\n"), c);
471 print_usage(); 471 print_usage();
472 break; 472 break;
473 } 473 }
@@ -494,30 +494,30 @@ int main(int argc, char **argv)
494 else if(timeout < warn.rta) timeout = warn.rta; 494 else if(timeout < warn.rta) timeout = warn.rta;
495 495
496 if((interval < MIN_INTERVAL * 100 || retry > MAX_RETRY) && getuid()) { 496 if((interval < MIN_INTERVAL * 100 || retry > MAX_RETRY) && getuid()) {
497 printf("%s: these options are too risky for mere mortals.\n", prog); 497 printf(_("%s: these options are too risky for mere mortals.\n"), prog);
498 printf("%s: You need i >= %u and r < %u\n", 498 printf(_("%s: You need i >= %u and r < %u\n"),
499 prog, MIN_INTERVAL, MAX_RETRY); 499 prog, MIN_INTERVAL, MAX_RETRY);
500 printf("Current settings; i = %d, r = %d\n", 500 printf(_("Current settings; i = %d, r = %d\n"),
501 interval / 100, retry); 501 interval / 100, retry);
502 print_usage(); 502 print_usage();
503 } 503 }
504 504
505 if((ping_data_size > MAX_PING_DATA) || (ping_data_size < MIN_PING_DATA)) { 505 if((ping_data_size > MAX_PING_DATA) || (ping_data_size < MIN_PING_DATA)) {
506 printf("%s: data size %u not valid, must be between %u and %u\n", 506 printf(_("%s: data size %u not valid, must be between %u and %u\n"),
507 prog, ping_data_size, MIN_PING_DATA, MAX_PING_DATA); 507 prog, ping_data_size, MIN_PING_DATA, MAX_PING_DATA);
508 print_usage(); 508 print_usage();
509 509
510 } 510 }
511 511
512 if((backoff > MAX_BACKOFF_FACTOR) || (backoff < MIN_BACKOFF_FACTOR)) { 512 if((backoff > MAX_BACKOFF_FACTOR) || (backoff < MIN_BACKOFF_FACTOR)) {
513 printf("%s: backoff factor %.1f not valid, must be between %.1f and %.1f\n", 513 printf(_("%s: backoff factor %.1f not valid, must be between %.1f and %.1f\n"),
514 prog, backoff, MIN_BACKOFF_FACTOR, MAX_BACKOFF_FACTOR); 514 prog, backoff, MIN_BACKOFF_FACTOR, MAX_BACKOFF_FACTOR);
515 print_usage(); 515 print_usage();
516 516
517 } 517 }
518 518
519 if(count > MAX_COUNT) { 519 if(count > MAX_COUNT) {
520 printf("%s: count %u not valid, must be less than %u\n", 520 printf(_("%s: count %u not valid, must be less than %u\n"),
521 prog, count, MAX_COUNT); 521 prog, count, MAX_COUNT);
522 print_usage(); 522 print_usage();
523 } 523 }
@@ -536,19 +536,19 @@ int main(int argc, char **argv)
536 536
537 /* generate requires command line parameters beyond the switches */ 537 /* generate requires command line parameters beyond the switches */
538 if(generate_flag && !*argv) { 538 if(generate_flag && !*argv) {
539 printf("generate flag requires command line parameters beyond switches\n"); 539 printf(_("Generate flag requires command line parameters beyond switches\n"));
540 print_usage(); 540 print_usage();
541 } 541 }
542 542
543 if(*argv && !generate_flag) { 543 if(*argv && !generate_flag) {
544 while(*argv) { 544 while(*argv) {
545 if(!(host_ptr->entry = malloc(strlen(*argv) + 1))) { 545 if(!(host_ptr->entry = malloc(strlen(*argv) + 1))) {
546 crash("Failed to allocate memory for hostname"); 546 crash(_("Failed to allocate memory for hostname"));
547 } 547 }
548 memset(host_ptr->entry, 0, strlen(*argv) + 1); 548 memset(host_ptr->entry, 0, strlen(*argv) + 1);
549 host_ptr->entry = memcpy(host_ptr->entry, *argv, strlen(*argv)); 549 host_ptr->entry = memcpy(host_ptr->entry, *argv, strlen(*argv));
550 if(!(host_ptr->next = malloc(sizeof(struct host_name_list)))) 550 if(!(host_ptr->next = malloc(sizeof(struct host_name_list))))
551 crash("Failed to allocate memory for hostname"); 551 crash(_("Failed to allocate memory for hostname"));
552 host_ptr = host_ptr->next; 552 host_ptr = host_ptr->next;
553 host_ptr->next = NULL; 553 host_ptr->next = NULL;
554 554
@@ -565,13 +565,13 @@ int main(int argc, char **argv)
565 } 565 }
566 566
567 if(!num_hosts) { 567 if(!num_hosts) {
568 printf("No hosts to work with!\n\n"); 568 printf(_("No hosts to work with!\n\n"));
569 print_usage(); 569 print_usage();
570 } 570 }
571 571
572 /* allocate array to hold outstanding ping requests */ 572 /* allocate array to hold outstanding ping requests */
573 table = (HOST_ENTRY **) malloc(sizeof(HOST_ENTRY *) * num_hosts); 573 table = (HOST_ENTRY **) malloc(sizeof(HOST_ENTRY *) * num_hosts);
574 if(!table) crash("Can't malloc array of hosts"); 574 if(!table) crash(_("Can't malloc array of hosts"));
575 575
576 cursor = rrlist; 576 cursor = rrlist;
577 577
@@ -703,7 +703,7 @@ void finish()
703 warn.pl, crit.pl); 703 warn.pl, crit.pl);
704 } 704 }
705 else { 705 else {
706 printf("%s is down (lost 100%%)", h->host); 706 printf(_("%s is down (lost 100%%)"), h->host);
707 } 707 }
708 } 708 }
709 else { 709 else {
@@ -754,7 +754,7 @@ void finish()
754 } 754 }
755 755
756 if(num_noaddress) { 756 if(num_noaddress) {
757 printf("No hostaddress specified.\n"); 757 printf(_("No hostaddress specified.\n"));
758 print_usage(); 758 print_usage();
759 } 759 }
760 else if(num_alive != num_hosts) { 760 else if(num_alive != num_hosts) {
@@ -765,10 +765,10 @@ void finish()
765 765
766 if(num_hosts > 1) { 766 if(num_hosts > 1) {
767 if(num_alive == num_hosts) { 767 if(num_alive == num_hosts) {
768 printf("OK - All %d hosts are alive\n", num_hosts); 768 printf(_("OK - All %d hosts are alive\n"), num_hosts);
769 } 769 }
770 else { 770 else {
771 printf("CRITICAL - %d of %d hosts are alive\n", num_alive, num_hosts); 771 printf(_("CRITICAL - %d of %d hosts are alive\n"), num_alive, num_hosts);
772 } 772 }
773 } 773 }
774 exit(fin_stat); 774 exit(fin_stat);
@@ -784,7 +784,7 @@ void send_ping(int lsock, HOST_ENTRY *h)
784 784
785 buffer = (char *)malloc((size_t) ping_pkt_size); 785 buffer = (char *)malloc((size_t) ping_pkt_size);
786 if(!buffer) 786 if(!buffer)
787 crash("can't malloc ping packet"); 787 crash(_("Can't malloc ping packet"));
788 788
789 memset(buffer, 0, ping_pkt_size * sizeof(char)); 789 memset(buffer, 0, ping_pkt_size * sizeof(char));
790 icp = (struct icmp *)buffer; 790 icp = (struct icmp *)buffer;
@@ -808,7 +808,7 @@ void send_ping(int lsock, HOST_ENTRY *h)
808 808
809 if(n < 0 || (unsigned int)n != ping_pkt_size) { 809 if(n < 0 || (unsigned int)n != ping_pkt_size) {
810 if(unreachable_flag) { 810 if(unreachable_flag) {
811 printf("%s error while sending ping: %s\n", 811 printf(_("%s error while sending ping: %s\n"),
812 h->host, strerror(errno)); 812 h->host, strerror(errno));
813 } /* IF */ 813 } /* IF */
814 814
@@ -860,7 +860,7 @@ int wait_for_reply(int lsock)
860#endif /* defined(__alpha__) && __STDC__ */ 860#endif /* defined(__alpha__) && __STDC__ */
861 861
862 if(result < hlen + ICMP_MINLEN) { 862 if(result < hlen + ICMP_MINLEN) {
863 printf("received packet too short for ICMP (%d bytes from %s)\n", result, 863 printf(_("Received packet too short for ICMP (%d bytes from %s)\n"), result,
864 inet_ntoa(response_addr.sin_addr)); 864 inet_ntoa(response_addr.sin_addr));
865 865
866 return (1); /* too short */ 866 return (1); /* too short */
@@ -903,7 +903,7 @@ int wait_for_reply(int lsock)
903 /* note reply time in array, probably */ 903 /* note reply time in array, probably */
904 if((this_count >= 0) && ((unsigned int)this_count < trials)) { 904 if((this_count >= 0) && ((unsigned int)this_count < trials)) {
905 if(h->resp_times[this_count] != RESP_WAITING) { 905 if(h->resp_times[this_count] != RESP_WAITING) {
906 printf("%s : duplicate for [%d], %d bytes, %s ms", 906 printf(_("%s : duplicate for [%d], %d bytes, %s ms"),
907 h->host, this_count, result, sprint_tm(this_reply)); 907 h->host, this_count, result, sprint_tm(this_reply));
908 908
909 if(response_addr.sin_addr.s_addr != h->saddr.sin_addr.s_addr) 909 if(response_addr.sin_addr.s_addr != h->saddr.sin_addr.s_addr)
@@ -913,7 +913,7 @@ int wait_for_reply(int lsock)
913 } /* IF */ 913 } /* IF */
914 else { 914 else {
915 /* count is out of bounds?? */ 915 /* count is out of bounds?? */
916 printf("%s : duplicate for [%d], %d bytes, %s ms\n", 916 printf(_("%s : duplicate for [%d], %d bytes, %s ms\n"),
917 h->host, this_count, result, sprint_tm(this_reply)); 917 h->host, this_count, result, sprint_tm(this_reply));
918 } /* ELSE */ 918 } /* ELSE */
919 919
@@ -942,12 +942,12 @@ int handle_random_icmp(struct icmp *p, struct sockaddr_in *addr)
942 h = table[sent_icmp->icmp_seq]; 942 h = table[sent_icmp->icmp_seq];
943 943
944 if(p->icmp_code > ICMP_UNREACH_MAXTYPE) { 944 if(p->icmp_code > ICMP_UNREACH_MAXTYPE) {
945 printf("ICMP Unreachable (Invalid Code) from %s for ICMP Echo sent to %s", 945 printf(_("ICMP Unreachable (Invalid Code) from %s for ICMP Echo sent to %s"),
946 inet_ntoa(addr->sin_addr), h->host); 946 inet_ntoa(addr->sin_addr), h->host);
947 947
948 } /* IF */ 948 } /* IF */
949 else { 949 else {
950 printf("ICMP Unreachable from %s for ICMP Echo sent to %s", 950 printf(_("ICMP Unreachable from %s for ICMP Echo sent to %s"),
951 inet_ntoa(addr->sin_addr), h->host); 951 inet_ntoa(addr->sin_addr), h->host);
952 952
953 } /* ELSE */ 953 } /* ELSE */
@@ -971,7 +971,7 @@ int handle_random_icmp(struct icmp *p, struct sockaddr_in *addr)
971 (sent_icmp->icmp_seq < (n_short) num_hosts)) { 971 (sent_icmp->icmp_seq < (n_short) num_hosts)) {
972 /* this is a response to a ping we sent */ 972 /* this is a response to a ping we sent */
973 h = table[sent_icmp->icmp_seq]; 973 h = table[sent_icmp->icmp_seq];
974 printf("ICMP Unreachable from %s for ICMP Echo sent to %s", 974 printf(_("ICMP Unreachable from %s for ICMP Echo sent to %s"),
975 inet_ntoa(addr->sin_addr), h->host); 975 inet_ntoa(addr->sin_addr), h->host);
976 976
977 if(inet_addr(h->host) == INADDR_NONE) 977 if(inet_addr(h->host) == INADDR_NONE)
@@ -1056,7 +1056,7 @@ void add_name(char *name)
1056 } /* IF */ 1056 } /* IF */
1057 1057
1058 if(host_ent == NULL) { 1058 if(host_ent == NULL) {
1059 printf("%s address not found\n", name); 1059 printf(_("%s address not found\n"), name);
1060 num_noaddress++; 1060 num_noaddress++;
1061 return; 1061 return;
1062 } /* IF */ 1062 } /* IF */
@@ -1064,7 +1064,7 @@ void add_name(char *name)
1064 1064
1065 host_add = (struct in_addr *)*(host_ent->h_addr_list); 1065 host_add = (struct in_addr *)*(host_ent->h_addr_list);
1066 if(host_add == NULL) { 1066 if(host_add == NULL) {
1067 printf("%s has no address data\n", name); 1067 printf(_("%s has no address data\n"), name);
1068 num_noaddress++; 1068 num_noaddress++;
1069 return; 1069 return;
1070 } /* IF */ 1070 } /* IF */
@@ -1097,7 +1097,7 @@ char *na_cat(char *name, struct in_addr ipaddr)
1097 nm = (char *)malloc(strlen(name) + strlen(as) + 4); 1097 nm = (char *)malloc(strlen(name) + strlen(as) + 4);
1098 1098
1099 if(!nm) 1099 if(!nm)
1100 crash("can't allocate some space for a string"); 1100 crash(_("Can't allocate some space for a string"));
1101 1101
1102 strcpy(nm, name); 1102 strcpy(nm, name);
1103 strcat(nm, " ("); 1103 strcat(nm, " (");
@@ -1116,7 +1116,7 @@ void add_addr(char *name, char *host, struct in_addr ipaddr)
1116 int *i; 1116 int *i;
1117 1117
1118 if(!(p = (HOST_ENTRY *) malloc(sizeof(HOST_ENTRY)))) { 1118 if(!(p = (HOST_ENTRY *) malloc(sizeof(HOST_ENTRY)))) {
1119 crash("can't allocate HOST_ENTRY"); 1119 crash(_("Can't allocate HOST_ENTRY"));
1120 } 1120 }
1121 1121
1122 memset((char *)p, 0, sizeof(HOST_ENTRY)); 1122 memset((char *)p, 0, sizeof(HOST_ENTRY));
@@ -1129,7 +1129,7 @@ void add_addr(char *name, char *host, struct in_addr ipaddr)
1129 1129
1130 /* array for response time results */ 1130 /* array for response time results */
1131 if(!(i = (int *)malloc(trials * sizeof(int)))) { 1131 if(!(i = (int *)malloc(trials * sizeof(int)))) {
1132 crash("can't allocate resp_times array"); 1132 crash(_("Can't allocate resp_times array"));
1133 } 1133 }
1134 1134
1135 for(n = 1; n < trials; n++) 1135 for(n = 1; n < trials; n++)
@@ -1193,7 +1193,7 @@ char *cpystr(char *string)
1193 1193
1194 if(string) { 1194 if(string) {
1195 dst = (char *)malloc(1 + strlen(string)); 1195 dst = (char *)malloc(1 + strlen(string));
1196 if(!dst) crash("malloc() failed!"); 1196 if(!dst) crash(_("malloc() failed!"));
1197 1197
1198 strcpy(dst, string); 1198 strcpy(dst, string);
1199 return dst; 1199 return dst;
@@ -1210,7 +1210,7 @@ void crash(char *msg)
1210 if(errno) 1210 if(errno)
1211 printf("%s: %s : %s\n", prog, msg, strerror(errno)); 1211 printf("%s: %s : %s\n", prog, msg, strerror(errno));
1212 if(h_errno) 1212 if(h_errno)
1213 printf("%s: %s : A network error occurred\n", prog, msg); 1213 printf(_("%s: %s : A network error occurred\n"), prog, msg);
1214 } 1214 }
1215 else printf("%s: %s\n", prog, msg); 1215 else printf("%s: %s\n", prog, msg);
1216 1216
@@ -1276,7 +1276,7 @@ void u_sleep(int u_sec)
1276 FD_ZERO(&readset); 1276 FD_ZERO(&readset);
1277 nfound = select(0, &readset, &writeset, NULL, &to); 1277 nfound = select(0, &readset, &writeset, NULL, &to);
1278 if(nfound < 0) 1278 if(nfound < 0)
1279 crash("select() in u_sleep:"); 1279 crash(_("select() in u_sleep:"));
1280 1280
1281 return; 1281 return;
1282} /* u_sleep() */ 1282} /* u_sleep() */
@@ -1306,14 +1306,14 @@ int recvfrom_wto(int lsock, char *buf, int len, struct sockaddr *saddr, int timo
1306 FD_ZERO(&writeset); 1306 FD_ZERO(&writeset);
1307 FD_SET(lsock, &readset); 1307 FD_SET(lsock, &readset);
1308 nfound = select(lsock + 1, &readset, &writeset, NULL, &to); 1308 nfound = select(lsock + 1, &readset, &writeset, NULL, &to);
1309 if(nfound < 0) crash("select() in recvfrom_wto"); 1309 if(nfound < 0) crash(_("select() in recvfrom_wto"));
1310 1310
1311 if(nfound == 0) return -1; /* timeout */ 1311 if(nfound == 0) return -1; /* timeout */
1312 1312
1313 if(nfound) { 1313 if(nfound) {
1314 slen = sizeof(struct sockaddr); 1314 slen = sizeof(struct sockaddr);
1315 n = recvfrom(sock, buf, len, 0, saddr, &slen); 1315 n = recvfrom(sock, buf, len, 0, saddr, &slen);
1316 if(n < 0) crash("recvfrom"); 1316 if(n < 0) crash(_("recvfrom"));
1317 return(n); 1317 return(n);
1318 } 1318 }
1319 1319
diff --git a/plugins/check_ide_smart.c b/plugins/check_ide_smart.c
index 644dc48..16cd1a8 100644
--- a/plugins/check_ide_smart.c
+++ b/plugins/check_ide_smart.c
@@ -206,9 +206,7 @@ main (int argc, char *argv[])
206 print_revision (progname, revision); 206 print_revision (progname, revision);
207 return STATE_OK; 207 return STATE_OK;
208 default: 208 default:
209 printf (_("%s: Unknown argument: %s\n\n"), progname, optarg); 209 usage2 (_("Unknown argument"), optarg);
210 print_usage ();
211 exit (STATE_UNKNOWN);
212 } 210 }
213 211
214 if (optind < argc) { 212 if (optind < argc) {
@@ -488,7 +486,6 @@ smart_read_thresholds (int fd, thresholds_t * thresholds)
488} 486}
489 487
490 488
491
492void 489void
493print_help () 490print_help ()
494{ 491{
@@ -515,7 +512,6 @@ Usage: %s [DEVICE] [OPTION]\n\
515} 512}
516 513
517 514
518
519void 515void
520print_usage (void) 516print_usage (void)
521{ 517{
diff --git a/plugins/check_ldap.c b/plugins/check_ldap.c
index 582c956..4f14328 100644
--- a/plugins/check_ldap.c
+++ b/plugins/check_ldap.c
@@ -134,11 +134,11 @@ main (int argc, char *argv[])
134 if (ldap_set_option (ld, LDAP_OPT_X_TLS, &tls) != LDAP_SUCCESS) 134 if (ldap_set_option (ld, LDAP_OPT_X_TLS, &tls) != LDAP_SUCCESS)
135 { 135 {
136 /*ldap_perror(ld, "ldaps_option"); */ 136 /*ldap_perror(ld, "ldaps_option"); */
137 printf ("Could not init TLS at port %i!\n", ld_port); 137 printf (_("Could not init TLS at port %i!\n"), ld_port);
138 return STATE_CRITICAL; 138 return STATE_CRITICAL;
139 } 139 }
140#else 140#else
141 printf ("TLS not supported by the libraries!\n", ld_port); 141 printf (_("TLS not supported by the libraries!\n"), ld_port);
142 return STATE_CRITICAL; 142 return STATE_CRITICAL;
143#endif /* LDAP_OPT_X_TLS */ 143#endif /* LDAP_OPT_X_TLS */
144 } else { 144 } else {
@@ -157,11 +157,11 @@ main (int argc, char *argv[])
157 if (ldap_start_tls_s(ld, NULL, NULL) != LDAP_SUCCESS) 157 if (ldap_start_tls_s(ld, NULL, NULL) != LDAP_SUCCESS)
158 { 158 {
159 /*ldap_perror(ld, "ldap_start_tls"); */ 159 /*ldap_perror(ld, "ldap_start_tls"); */
160 printf ("Could not init startTLS at port %i!\n", ld_port); 160 printf (_("Could not init startTLS at port %i!\n"), ld_port);
161 return STATE_CRITICAL; 161 return STATE_CRITICAL;
162 } 162 }
163#else 163#else
164 printf ("startTLS not supported by the library, needs LDAPv3!\n"); 164 printf (_("startTLS not supported by the library, needs LDAPv3!\n"));
165 return STATE_CRITICAL; 165 return STATE_CRITICAL;
166#endif /* HAVE_LDAP_START_TLS_S */ 166#endif /* HAVE_LDAP_START_TLS_S */
167 } 167 }
@@ -312,9 +312,7 @@ process_arguments (int argc, char **argv)
312#endif 312#endif
313 break; 313 break;
314 default: 314 default:
315 printf (_("%s: Unknown argument: %s\n\n"), progname, optarg); 315 usage2 (_("Unknown argument"), optarg);
316 print_usage ();
317 exit (STATE_UNKNOWN);
318 } 316 }
319 } 317 }
320 318
@@ -328,21 +326,20 @@ process_arguments (int argc, char **argv)
328 return validate_arguments (); 326 return validate_arguments ();
329} 327}
330 328
329
331int 330int
332validate_arguments () 331validate_arguments ()
333{ 332{
334 if (ld_host==NULL || strlen(ld_host)==0) 333 if (ld_host==NULL || strlen(ld_host)==0)
335 usage (_("please specify the host name\n")); 334 usage4 (_("Please specify the host name\n"));
336 335
337 if (ld_base==NULL || strlen(ld_base)==0) 336 if (ld_base==NULL || strlen(ld_base)==0)
338 usage (_("please specify the LDAP base\n")); 337 usage4 (_("Please specify the LDAP base\n"));
339 338
340 return OK; 339 return OK;
341
342} 340}
343 341
344 342
345
346void 343void
347print_help (void) 344print_help (void)
348{ 345{
@@ -392,7 +389,6 @@ print_help (void)
392} 389}
393 390
394 391
395
396void 392void
397print_usage (void) 393print_usage (void)
398{ 394{
diff --git a/plugins/check_load.c b/plugins/check_load.c
index 1b7865c..7e1cc48 100644
--- a/plugins/check_load.c
+++ b/plugins/check_load.c
@@ -224,9 +224,7 @@ process_arguments (int argc, char **argv)
224 print_help (); 224 print_help ();
225 exit (STATE_OK); 225 exit (STATE_OK);
226 case '?': /* help */ 226 case '?': /* help */
227 printf (_("%s: Unknown argument: %s\n\n"), progname, optarg); 227 usage2 (_("Unknown argument"), optarg);
228 print_usage ();
229 exit (STATE_UNKNOWN);
230 } 228 }
231 } 229 }
232 230
diff --git a/plugins/check_mrtg.c b/plugins/check_mrtg.c
index bd37aef..067429c 100644
--- a/plugins/check_mrtg.c
+++ b/plugins/check_mrtg.c
@@ -233,9 +233,7 @@ process_arguments (int argc, char **argv)
233 print_help (); 233 print_help ();
234 exit (STATE_OK); 234 exit (STATE_OK);
235 case '?': /* help */ 235 case '?': /* help */
236 printf (_("%s: Unknown argument: %s\n\n"), progname, optarg); 236 usage2 (_("Unknown argument"), optarg);
237 print_usage ();
238 exit (STATE_UNKNOWN);
239 } 237 }
240 } 238 }
241 239
diff --git a/plugins/check_mrtgtraf.c b/plugins/check_mrtgtraf.c
index 096b3bd..877072c 100644
--- a/plugins/check_mrtgtraf.c
+++ b/plugins/check_mrtgtraf.c
@@ -260,9 +260,7 @@ process_arguments (int argc, char **argv)
260 print_help (); 260 print_help ();
261 exit (STATE_OK); 261 exit (STATE_OK);
262 case '?': /* help */ 262 case '?': /* help */
263 printf (_("%s: Unknown argument: %s\n\n"), progname, optarg); 263 usage2 (_("Unknown argument"), optarg);
264 print_usage ();
265 exit (STATE_UNKNOWN);
266 } 264 }
267 } 265 }
268 266
@@ -304,7 +302,6 @@ process_arguments (int argc, char **argv)
304} 302}
305 303
306 304
307
308int 305int
309validate_arguments (void) 306validate_arguments (void)
310{ 307{
@@ -312,7 +309,6 @@ validate_arguments (void)
312} 309}
313 310
314 311
315
316void 312void
317print_help (void) 313print_help (void)
318{ 314{
diff --git a/plugins/check_mysql.c b/plugins/check_mysql.c
index 1e7a82f..735eaa2 100644
--- a/plugins/check_mysql.c
+++ b/plugins/check_mysql.c
@@ -98,25 +98,25 @@ main (int argc, char **argv)
98 /* check the slave status */ 98 /* check the slave status */
99 if (mysql_query (&mysql, "show slave status") != 0) { 99 if (mysql_query (&mysql, "show slave status") != 0) {
100 mysql_close (&mysql); 100 mysql_close (&mysql);
101 die (STATE_CRITICAL, "slave query error: %s\n", mysql_error (&mysql)); 101 die (STATE_CRITICAL, _("slave query error: %s\n"), mysql_error (&mysql));
102 } 102 }
103 103
104 /* store the result */ 104 /* store the result */
105 if ( (res = mysql_store_result (&mysql)) == NULL) { 105 if ( (res = mysql_store_result (&mysql)) == NULL) {
106 mysql_close (&mysql); 106 mysql_close (&mysql);
107 die (STATE_CRITICAL, "slave store_result error: %s\n", mysql_error (&mysql)); 107 die (STATE_CRITICAL, _("slave store_result error: %s\n"), mysql_error (&mysql));
108 } 108 }
109 109
110 /* fetch the first row */ 110 /* fetch the first row */
111 if ( (row = mysql_fetch_row (res)) == NULL) { 111 if ( (row = mysql_fetch_row (res)) == NULL) {
112 mysql_free_result (res); 112 mysql_free_result (res);
113 mysql_close (&mysql); 113 mysql_close (&mysql);
114 die (STATE_CRITICAL, "slave fetch row error: %s\n", mysql_error (&mysql)); 114 die (STATE_CRITICAL, _("slave fetch row error: %s\n"), mysql_error (&mysql));
115 } 115 }
116 116
117 if (mysql_field_count (&mysql) == 12) { 117 if (mysql_field_count (&mysql) == 12) {
118 /* mysql 3.23.x */ 118 /* mysql 3.23.x */
119 snprintf (slaveresult, SLAVERESULTSIZE, "Slave running: %s", row[6]); 119 snprintf (slaveresult, SLAVERESULTSIZE, _("Slave running: %s"), row[6]);
120 if (strcmp (row[6], "Yes") != 0) { 120 if (strcmp (row[6], "Yes") != 0) {
121 mysql_free_result (res); 121 mysql_free_result (res);
122 mysql_close (&mysql); 122 mysql_close (&mysql);
@@ -151,7 +151,6 @@ main (int argc, char **argv)
151} 151}
152 152
153 153
154
155/* process command-line arguments */ 154/* process command-line arguments */
156int 155int
157process_arguments (int argc, char **argv) 156process_arguments (int argc, char **argv)
@@ -212,9 +211,7 @@ process_arguments (int argc, char **argv)
212 print_help (); 211 print_help ();
213 exit (STATE_OK); 212 exit (STATE_OK);
214 case '?': /* help */ 213 case '?': /* help */
215 printf (_("%s: Unknown argument: %s\n\n"), progname, optarg); 214 usage2 (_("Unknown argument"), optarg);
216 print_usage ();
217 exit (STATE_UNKNOWN);
218 } 215 }
219 } 216 }
220 217
@@ -245,7 +242,6 @@ process_arguments (int argc, char **argv)
245} 242}
246 243
247 244
248
249int 245int
250validate_arguments (void) 246validate_arguments (void)
251{ 247{
@@ -265,7 +261,6 @@ validate_arguments (void)
265} 261}
266 262
267 263
268
269void 264void
270print_help (void) 265print_help (void)
271{ 266{
@@ -304,7 +299,6 @@ a server listening on MySQL standard port %d will be checked\n"), MYSQL_PORT);
304} 299}
305 300
306 301
307
308void 302void
309print_usage (void) 303print_usage (void)
310{ 304{
diff --git a/plugins/check_nagios.c b/plugins/check_nagios.c
index 465b409..0176983 100644
--- a/plugins/check_nagios.c
+++ b/plugins/check_nagios.c
@@ -95,7 +95,7 @@ main (int argc, char **argv)
95 fclose (fp); 95 fclose (fp);
96 96
97 if (verbose >= 2) 97 if (verbose >= 2)
98 printf("command: %s\n", PS_COMMAND); 98 printf(_("command: %s\n"), PS_COMMAND);
99 99
100 /* run the command to check for the Nagios process.. */ 100 /* run the command to check for the Nagios process.. */
101 child_process = spopen (PS_COMMAND); 101 child_process = spopen (PS_COMMAND);
@@ -206,8 +206,7 @@ process_arguments (int argc, char **argv)
206 expire_minutes = atoi (argv[2]); 206 expire_minutes = atoi (argv[2]);
207 else 207 else
208 die (STATE_UNKNOWN, 208 die (STATE_UNKNOWN,
209 _("Expiration time must be an integer (seconds)\nType '%s -h' for additional help\n"), 209 _("Expiration time must be an integer (seconds)\n"));
210 progname);
211 process_string = argv[3]; 210 process_string = argv[3];
212 return OK; 211 return OK;
213 } 212 }
@@ -220,9 +219,7 @@ process_arguments (int argc, char **argv)
220 219
221 switch (c) { 220 switch (c) {
222 case '?': /* print short usage statement if args not parsable */ 221 case '?': /* print short usage statement if args not parsable */
223 printf (_("%s: Unknown argument: %c\n\n"), progname, optopt); 222 usage2 (_("Unknown argument"), optarg);
224 print_usage ();
225 exit (STATE_UNKNOWN);
226 case 'h': /* help */ 223 case 'h': /* help */
227 print_help (); 224 print_help ();
228 exit (STATE_OK); 225 exit (STATE_OK);
@@ -240,8 +237,7 @@ process_arguments (int argc, char **argv)
240 expire_minutes = atoi (optarg); 237 expire_minutes = atoi (optarg);
241 else 238 else
242 die (STATE_UNKNOWN, 239 die (STATE_UNKNOWN,
243 _("Expiration time must be an integer (seconds)\nType '%s -h' for additional help\n"), 240 _("Expiration time must be an integer (seconds)\n"));
244 progname);
245 break; 241 break;
246 case 'v': 242 case 'v':
247 verbose++; 243 verbose++;
@@ -252,12 +248,10 @@ process_arguments (int argc, char **argv)
252 248
253 if (status_log == NULL) 249 if (status_log == NULL)
254 die (STATE_UNKNOWN, 250 die (STATE_UNKNOWN,
255 _("You must provide the status_log\nType '%s -h' for additional help\n"), 251 _("You must provide the status_log\n"));
256 progname);
257 else if (process_string == NULL) 252 else if (process_string == NULL)
258 die (STATE_UNKNOWN, 253 die (STATE_UNKNOWN,
259 _("You must provide a process string\nType '%s -h' for additional help\n"), 254 _("You must provide a process string\n"));
260 progname);
261 255
262 return OK; 256 return OK;
263} 257}
diff --git a/plugins/check_nt.c b/plugins/check_nt.c
index fa93fce..cac826f 100644
--- a/plugins/check_nt.c
+++ b/plugins/check_nt.c
@@ -423,7 +423,7 @@ int main(int argc, char **argv){
423 423
424 case CHECK_NONE: 424 case CHECK_NONE:
425 default: 425 default:
426 usage (_("Please specify a variable to check")); 426 usage4 (_("Please specify a variable to check"));
427 break; 427 break;
428 428
429 } 429 }
@@ -487,14 +487,12 @@ int process_arguments(int argc, char **argv){
487 switch (c) 487 switch (c)
488 { 488 {
489 case '?': /* print short usage statement if args not parsable */ 489 case '?': /* print short usage statement if args not parsable */
490 printf("%s: Unknown argument: %s\n\n",progname,optarg); 490 usage2 (_("Unknown argument"), optarg);
491 print_usage();
492 exit(STATE_UNKNOWN);
493 case 'h': /* help */ 491 case 'h': /* help */
494 print_help(); 492 print_help();
495 exit(STATE_OK); 493 exit(STATE_OK);
496 case 'V': /* version */ 494 case 'V': /* version */
497 print_revision(progname,"$Revision$"); 495 print_revision(progname,revision);
498 exit(STATE_OK); 496 exit(STATE_OK);
499 case 'H': /* hostname */ 497 case 'H': /* hostname */
500 if (server_address) free(server_address); 498 if (server_address) free(server_address);
@@ -507,7 +505,7 @@ int process_arguments(int argc, char **argv){
507 if (is_intnonneg(optarg)) 505 if (is_intnonneg(optarg))
508 server_port=atoi(optarg); 506 server_port=atoi(optarg);
509 else 507 else
510 die(STATE_UNKNOWN,_("Server port an integer (seconds)\nType '%s -h' for additional help\n"),progname); 508 die(STATE_UNKNOWN,_("Server port must be an integer\n"));
511 break; 509 break;
512 case 'v': 510 case 'v':
513 if(strlen(optarg)<4) 511 if(strlen(optarg)<4)
@@ -573,7 +571,7 @@ void fetch_data (const char *address, int port, const char *sendb) {
573 result=process_tcp_request(address, port, sendb, recv_buffer,sizeof(recv_buffer)); 571 result=process_tcp_request(address, port, sendb, recv_buffer,sizeof(recv_buffer));
574 572
575 if(result!=STATE_OK) 573 if(result!=STATE_OK)
576 die (result, "could not fetch information from server\n"); 574 die (result, _("could not fetch information from server\n"));
577 575
578 if (!strncmp(recv_buffer,"ERROR",5)) 576 if (!strncmp(recv_buffer,"ERROR",5))
579 die (STATE_UNKNOWN, "NSClient - %s\n",recv_buffer); 577 die (STATE_UNKNOWN, "NSClient - %s\n",recv_buffer);
diff --git a/plugins/check_nwstat.c b/plugins/check_nwstat.c
index 2d7e611..601b25d 100644
--- a/plugins/check_nwstat.c
+++ b/plugins/check_nwstat.c
@@ -760,9 +760,7 @@ int process_arguments(int argc, char **argv) {
760 switch (c) 760 switch (c)
761 { 761 {
762 case '?': /* print short usage statement if args not parsable */ 762 case '?': /* print short usage statement if args not parsable */
763 printf ("%s: Unknown argument: %s\n\n", progname, optarg); 763 usage2 (_("Unknown argument"), optarg);
764 print_usage();
765 exit(STATE_UNKNOWN);
766 case 'h': /* help */ 764 case 'h': /* help */
767 print_help(); 765 print_help();
768 exit(STATE_OK); 766 exit(STATE_OK);
@@ -779,7 +777,7 @@ int process_arguments(int argc, char **argv) {
779 if (is_intnonneg(optarg)) 777 if (is_intnonneg(optarg))
780 server_port=atoi(optarg); 778 server_port=atoi(optarg);
781 else 779 else
782 die(STATE_UNKNOWN,_("Server port an integer (seconds)\nType '%s -h' for additional help\n"),progname); 780 die(STATE_UNKNOWN,_("Server port an integer\n"));
783 break; 781 break;
784 case 'v': 782 case 'v':
785 if (strlen(optarg)<3) 783 if (strlen(optarg)<3)
diff --git a/plugins/check_overcr.c b/plugins/check_overcr.c
index 9bf40d3..a4abf2b 100644
--- a/plugins/check_overcr.c
+++ b/plugins/check_overcr.c
@@ -272,17 +272,9 @@ main (int argc, char **argv)
272 die (STATE_UNKNOWN, _("Nothing to check!\n")); 272 die (STATE_UNKNOWN, _("Nothing to check!\n"));
273 break; 273 break;
274 } 274 }
275
276 /* reset timeout */
277/* alarm (0); */
278
279/* printf (_("Reached end of program with no data returned\n")); */
280
281/* return result; */
282} 275}
283 276
284 277
285
286/* process command-line arguments */ 278/* process command-line arguments */
287int 279int
288process_arguments (int argc, char **argv) 280process_arguments (int argc, char **argv)
@@ -332,9 +324,7 @@ process_arguments (int argc, char **argv)
332 324
333 switch (c) { 325 switch (c) {
334 case '?': /* print short usage statement if args not parsable */ 326 case '?': /* print short usage statement if args not parsable */
335 printf (_("%s: Unknown argument: %s\n\n"), progname, optarg); 327 usage2 (_("Unknown argument"), optarg);
336 print_usage ();
337 exit (STATE_UNKNOWN);
338 case 'h': /* help */ 328 case 'h': /* help */
339 print_help (); 329 print_help ();
340 exit (STATE_OK); 330 exit (STATE_OK);
@@ -349,8 +339,7 @@ process_arguments (int argc, char **argv)
349 server_port = atoi (optarg); 339 server_port = atoi (optarg);
350 else 340 else
351 die (STATE_UNKNOWN, 341 die (STATE_UNKNOWN,
352 _("Server port an integer (seconds)\nType '%s -h' for additional help\n"), 342 _("Server port an integer\n"));
353 progname);
354 break; 343 break;
355 case 'v': /* variable */ 344 case 'v': /* variable */
356 if (strcmp (optarg, "LOAD") == 0) { 345 if (strcmp (optarg, "LOAD") == 0) {
@@ -403,7 +392,6 @@ process_arguments (int argc, char **argv)
403} 392}
404 393
405 394
406
407void 395void
408print_help (void) 396print_help (void)
409{ 397{
@@ -459,7 +447,6 @@ Notes:\n\
459} 447}
460 448
461 449
462
463void 450void
464print_usage (void) 451print_usage (void)
465{ 452{
diff --git a/plugins/check_pgsql.c b/plugins/check_pgsql.c
index b5b9ff8..d56ce9b 100644
--- a/plugins/check_pgsql.c
+++ b/plugins/check_pgsql.c
@@ -209,9 +209,7 @@ process_arguments (int argc, char **argv)
209 209
210 switch (c) { 210 switch (c) {
211 case '?': /* usage */ 211 case '?': /* usage */
212 printf (_("%s: Unknown argument: %s\n\n"), progname, optarg); 212 usage2 (_("Unknown argument"), optarg);
213 print_usage ();
214 exit (STATE_UNKNOWN);
215 case 'h': /* help */ 213 case 'h': /* help */
216 print_help (); 214 print_help ();
217 exit (STATE_OK); 215 exit (STATE_OK);
@@ -232,7 +230,7 @@ process_arguments (int argc, char **argv)
232 break; 230 break;
233 case 'w': /* warning time threshold */ 231 case 'w': /* warning time threshold */
234 if (!is_nonnegative (optarg)) 232 if (!is_nonnegative (optarg))
235 usage2 (_("Critical threshold must be a positive integer"), optarg); 233 usage2 (_("Warning threshold must be a positive integer"), optarg);
236 else 234 else
237 twarn = strtod (optarg, NULL); 235 twarn = strtod (optarg, NULL);
238 break; 236 break;
diff --git a/plugins/check_ping.c b/plugins/check_ping.c
index 9176466..818bb66 100644
--- a/plugins/check_ping.c
+++ b/plugins/check_ping.c
@@ -194,9 +194,7 @@ process_arguments (int argc, char **argv)
194 194
195 switch (c) { 195 switch (c) {
196 case '?': /* usage */ 196 case '?': /* usage */
197 printf (_("%s: Unknown argument: %s\n\n"), progname, optarg); 197 usage2 (_("Unknown argument"), optarg);
198 print_usage ();
199 exit (STATE_UNKNOWN);
200 case 'h': /* help */ 198 case 'h': /* help */
201 print_help (); 199 print_help ();
202 exit (STATE_OK); 200 exit (STATE_OK);
diff --git a/plugins/check_procs.c b/plugins/check_procs.c
index 1be93f4..0cd9153 100644
--- a/plugins/check_procs.c
+++ b/plugins/check_procs.c
@@ -343,9 +343,7 @@ process_arguments (int argc, char **argv)
343 343
344 switch (c) { 344 switch (c) {
345 case '?': /* help */ 345 case '?': /* help */
346 printf (_("%s: Unknown argument: %s\n\n"), progname, optarg); 346 usage2 (_("Unknown argument"), optarg);
347 print_usage ();
348 exit (STATE_UNKNOWN);
349 case 'h': /* help */ 347 case 'h': /* help */
350 print_help (); 348 print_help ();
351 exit (STATE_OK); 349 exit (STATE_OK);
@@ -368,7 +366,7 @@ process_arguments (int argc, char **argv)
368 else if (sscanf (optarg, "%d:", &cmin) == 1) 366 else if (sscanf (optarg, "%d:", &cmin) == 1)
369 break; 367 break;
370 else 368 else
371 usage (_("Critical Process Count must be an integer!\n\n")); 369 usage4 (_("Critical Process Count must be an integer!"));
372 break; 370 break;
373 case 'w': /* warning threshold */ 371 case 'w': /* warning threshold */
374 if (is_integer (optarg)) 372 if (is_integer (optarg))
@@ -380,7 +378,7 @@ process_arguments (int argc, char **argv)
380 else if (sscanf (optarg, "%d:", &wmin) == 1) 378 else if (sscanf (optarg, "%d:", &wmin) == 1)
381 break; 379 break;
382 else 380 else
383 usage (_("Warning Process Count must be an integer!\n\n")); 381 usage4 (_("Warning Process Count must be an integer!"));
384 break; 382 break;
385 case 'p': /* process id */ 383 case 'p': /* process id */
386 if (sscanf (optarg, "%d%[^0-9]", &ppid, tmp) == 1) { 384 if (sscanf (optarg, "%d%[^0-9]", &ppid, tmp) == 1) {
@@ -388,7 +386,7 @@ process_arguments (int argc, char **argv)
388 options |= PPID; 386 options |= PPID;
389 break; 387 break;
390 } 388 }
391 usage2 (_("%s: Parent Process ID must be an integer!\n\n"), progname); 389 usage4 (_("Parent Process ID must be an integer!"));
392 case 's': /* status */ 390 case 's': /* status */
393 if (statopts) 391 if (statopts)
394 break; 392 break;
@@ -403,13 +401,13 @@ process_arguments (int argc, char **argv)
403 pw = getpwuid ((uid_t) uid); 401 pw = getpwuid ((uid_t) uid);
404 /* check to be sure user exists */ 402 /* check to be sure user exists */
405 if (pw == NULL) 403 if (pw == NULL)
406 usage2 (_("UID %s was not found\n"), optarg); 404 usage2 (_("UID %s was not found"), optarg);
407 } 405 }
408 else { 406 else {
409 pw = getpwnam (optarg); 407 pw = getpwnam (optarg);
410 /* check to be sure user exists */ 408 /* check to be sure user exists */
411 if (pw == NULL) 409 if (pw == NULL)
412 usage2 (_("User name %s was not found\n"), optarg); 410 usage2 (_("User name %s was not found"), optarg);
413 /* then get uid */ 411 /* then get uid */
414 uid = pw->pw_uid; 412 uid = pw->pw_uid;
415 } 413 }
@@ -443,14 +441,14 @@ process_arguments (int argc, char **argv)
443 options |= RSS; 441 options |= RSS;
444 break; 442 break;
445 } 443 }
446 usage2 (_("%s: RSS must be an integer!\n\n"), progname); 444 usage4 (_("RSS must be an integer!"));
447 case 'z': /* VSZ */ 445 case 'z': /* VSZ */
448 if (sscanf (optarg, "%d%[^0-9]", &vsz, tmp) == 1) { 446 if (sscanf (optarg, "%d%[^0-9]", &vsz, tmp) == 1) {
449 asprintf (&fmt, _("%s%sVSZ >= %d"), (fmt ? fmt : ""), (options ? ", " : ""), vsz); 447 asprintf (&fmt, _("%s%sVSZ >= %d"), (fmt ? fmt : ""), (options ? ", " : ""), vsz);
450 options |= VSZ; 448 options |= VSZ;
451 break; 449 break;
452 } 450 }
453 usage2 (_("%s: VSZ must be an integer!\n\n"), progname); 451 usage4 (_("VSZ must be an integer!"));
454 case 'P': /* PCPU */ 452 case 'P': /* PCPU */
455 /* TODO: -P 1.5.5 is accepted */ 453 /* TODO: -P 1.5.5 is accepted */
456 if (sscanf (optarg, "%f%[^0-9.]", &pcpu, tmp) == 1) { 454 if (sscanf (optarg, "%f%[^0-9.]", &pcpu, tmp) == 1) {
@@ -458,7 +456,7 @@ process_arguments (int argc, char **argv)
458 options |= PCPU; 456 options |= PCPU;
459 break; 457 break;
460 } 458 }
461 usage2 (_("%s: PCPU must be a float!\n\n"), progname); 459 usage4 (_("PCPU must be a float!"));
462 case 'm': 460 case 'm':
463 asprintf (&metric_name, "%s", optarg); 461 asprintf (&metric_name, "%s", optarg);
464 if ( strcmp(optarg, "PROCS") == 0) { 462 if ( strcmp(optarg, "PROCS") == 0) {
@@ -482,10 +480,7 @@ process_arguments (int argc, char **argv)
482 break; 480 break;
483 } 481 }
484 482
485 printf (_("%s: metric must be one of PROCS, VSZ, RSS, CPU, ELAPSED!\n\n"), 483 usage4 (_("Metric must be one of PROCS, VSZ, RSS, CPU, ELAPSED!"));
486 progname);
487 print_usage ();
488 exit (STATE_UNKNOWN);
489 case 'v': /* command */ 484 case 'v': /* command */
490 verbose++; 485 verbose++;
491 break; 486 break;
@@ -588,8 +583,6 @@ check_thresholds (int value)
588} 583}
589 584
590 585
591
592
593/* convert the elapsed time to seconds */ 586/* convert the elapsed time to seconds */
594int 587int
595convert_to_seconds(char *etime) { 588convert_to_seconds(char *etime) {
@@ -653,7 +646,6 @@ convert_to_seconds(char *etime) {
653} 646}
654 647
655 648
656
657void 649void
658print_help (void) 650print_help (void)
659{ 651{
diff --git a/plugins/check_radius.c b/plugins/check_radius.c
index 9e10468..07ee4c7 100644
--- a/plugins/check_radius.c
+++ b/plugins/check_radius.c
@@ -199,12 +199,12 @@ process_arguments (int argc, char **argv)
199 if (is_intpos (argv[5])) 199 if (is_intpos (argv[5]))
200 retries = atoi (argv[5]); 200 retries = atoi (argv[5]);
201 else 201 else
202 usage (_("Number of retries must be a positive integer")); 202 usage4 (_("Number of retries must be a positive integer"));
203 server = argv[6]; 203 server = argv[6];
204 if (is_intpos (argv[7])) 204 if (is_intpos (argv[7]))
205 port = atoi (argv[7]); 205 port = atoi (argv[7]);
206 else 206 else
207 usage (_("Port must be a positive integer")); 207 usage4 (_("Port must be a positive integer"));
208 expect = argv[8]; 208 expect = argv[8];
209 return OK; 209 return OK;
210 } 210 }
@@ -218,9 +218,7 @@ process_arguments (int argc, char **argv)
218 218
219 switch (c) { 219 switch (c) {
220 case '?': /* print short usage statement if args not parsable */ 220 case '?': /* print short usage statement if args not parsable */
221 printf (_("%s: Unknown argument: %s\n\n"), progname, optarg); 221 usage2 (_("Unknown argument"), optarg);
222 print_usage ();
223 exit (STATE_UNKNOWN);
224 case 'h': /* help */ 222 case 'h': /* help */
225 print_help (); 223 print_help ();
226 exit (OK); 224 exit (OK);
@@ -240,7 +238,7 @@ process_arguments (int argc, char **argv)
240 if (is_intnonneg (optarg)) 238 if (is_intnonneg (optarg))
241 port = atoi (optarg); 239 port = atoi (optarg);
242 else 240 else
243 usage (_("Port must be a positive integer")); 241 usage4 (_("Port must be a positive integer"));
244 break; 242 break;
245 case 'u': /* username */ 243 case 'u': /* username */
246 username = optarg; 244 username = optarg;
@@ -261,7 +259,7 @@ process_arguments (int argc, char **argv)
261 if (is_intpos (optarg)) 259 if (is_intpos (optarg))
262 retries = atoi (optarg); 260 retries = atoi (optarg);
263 else 261 else
264 usage (_("Number of retries must be a positive integer")); 262 usage4 (_("Number of retries must be a positive integer"));
265 break; 263 break;
266 case 't': /* timeout */ 264 case 't': /* timeout */
267 if (is_intpos (optarg)) 265 if (is_intpos (optarg))
diff --git a/plugins/check_real.c b/plugins/check_real.c
index 3042465..eb892c7 100644
--- a/plugins/check_real.c
+++ b/plugins/check_real.c
@@ -330,7 +330,7 @@ process_arguments (int argc, char **argv)
330 check_critical_time = TRUE; 330 check_critical_time = TRUE;
331 } 331 }
332 else { 332 else {
333 usage4 (_("Critical time must be a nonnegative integer")); 333 usage4 (_("Critical time must be a positive integer"));
334 } 334 }
335 break; 335 break;
336 case 'v': /* verbose */ 336 case 'v': /* verbose */
@@ -341,7 +341,7 @@ process_arguments (int argc, char **argv)
341 socket_timeout = atoi (optarg); 341 socket_timeout = atoi (optarg);
342 } 342 }
343 else { 343 else {
344 usage4 (_("Time interval must be a nonnegative integer")); 344 usage4 (_("Timeout interval must be a positive integer"));
345 } 345 }
346 break; 346 break;
347 case 'V': /* version */ 347 case 'V': /* version */
@@ -351,9 +351,7 @@ process_arguments (int argc, char **argv)
351 print_help (); 351 print_help ();
352 exit (STATE_OK); 352 exit (STATE_OK);
353 case '?': /* usage */ 353 case '?': /* usage */
354 printf (_("%s: Unknown argument: %s\n\n"), progname, optarg); 354 usage2 (_("Unknown argument"), optarg);
355 print_usage ();
356 exit (STATE_UNKNOWN);
357 } 355 }
358 } 356 }
359 357
@@ -368,7 +366,7 @@ process_arguments (int argc, char **argv)
368 } 366 }
369 367
370 if (server_address==NULL) 368 if (server_address==NULL)
371 usage (_("You must provide a server to check\n")); 369 usage4 (_("You must provide a server to check"));
372 370
373 if (host_name==NULL) 371 if (host_name==NULL)
374 host_name = strdup (server_address); 372 host_name = strdup (server_address);
diff --git a/plugins/check_smtp.c b/plugins/check_smtp.c
index b6c60c2..55cf5da 100644
--- a/plugins/check_smtp.c
+++ b/plugins/check_smtp.c
@@ -351,7 +351,7 @@ process_arguments (int argc, char **argv)
351 socket_timeout = atoi (optarg); 351 socket_timeout = atoi (optarg);
352 } 352 }
353 else { 353 else {
354 usage4 (_("Time interval must be a positive integer")); 354 usage4 (_("Timeout interval must be a positive integer"));
355 } 355 }
356 break; 356 break;
357 case '4': 357 case '4':
@@ -371,9 +371,7 @@ process_arguments (int argc, char **argv)
371 print_help (); 371 print_help ();
372 exit (STATE_OK); 372 exit (STATE_OK);
373 case '?': /* help */ 373 case '?': /* help */
374 printf (_("%s: Unknown argument: %s\n\n"), progname, optarg); 374 usage2 (_("Unknown argument"), optarg);
375 print_usage ();
376 exit (STATE_UNKNOWN);
377 } 375 }
378 } 376 }
379 377
diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c
index c1c4ea8..5f22121 100644
--- a/plugins/check_snmp.c
+++ b/plugins/check_snmp.c
@@ -251,7 +251,7 @@ main (int argc, char **argv)
251 eval_method[i] & WARN_NE) { 251 eval_method[i] & WARN_NE) {
252 p2 = strpbrk (p2, "0123456789"); 252 p2 = strpbrk (p2, "0123456789");
253 if (p2 == NULL) 253 if (p2 == NULL)
254 die (STATE_UNKNOWN,"No valid data returned"); 254 die (STATE_UNKNOWN,_("No valid data returned"));
255 response_value[i] = strtoul (p2, NULL, 10); 255 response_value[i] = strtoul (p2, NULL, 10);
256 iresult = check_num (i); 256 iresult = check_num (i);
257 asprintf (&show, "%lu", response_value[i]); 257 asprintf (&show, "%lu", response_value[i]);
@@ -398,9 +398,7 @@ process_arguments (int argc, char **argv)
398 398
399 switch (c) { 399 switch (c) {
400 case '?': /* usage */ 400 case '?': /* usage */
401 printf (_("%s: Unknown argument: %s\n\n"), progname, optarg); 401 usage2 (_("Unknown argument"), optarg);
402 print_usage ();
403 exit (STATE_UNKNOWN);
404 case 'h': /* help */ 402 case 'h': /* help */
405 print_help (); 403 print_help ();
406 exit (STATE_OK); 404 exit (STATE_OK);
@@ -795,7 +793,7 @@ thisarg (char *str)
795 str += strspn (str, " \t\r\n"); /* trim any leading whitespace */ 793 str += strspn (str, " \t\r\n"); /* trim any leading whitespace */
796 if (strstr (str, "'") == str) { /* handle SIMPLE quoted strings */ 794 if (strstr (str, "'") == str) { /* handle SIMPLE quoted strings */
797 if (strlen (str) == 1 || !strstr (str + 1, "'")) 795 if (strlen (str) == 1 || !strstr (str + 1, "'"))
798 die (STATE_UNKNOWN, "Unbalanced quotes\n"); 796 die (STATE_UNKNOWN, _("Unbalanced quotes\n"));
799 } 797 }
800 return str; 798 return str;
801} 799}
diff --git a/plugins/check_ssh.c b/plugins/check_ssh.c
index e957c05..7b7bc8f 100644
--- a/plugins/check_ssh.c
+++ b/plugins/check_ssh.c
@@ -110,9 +110,7 @@ process_arguments (int argc, char **argv)
110 110
111 switch (c) { 111 switch (c) {
112 case '?': /* help */ 112 case '?': /* help */
113 printf (_("%s: Unknown argument: %s\n\n"), progname, optarg); 113 usage2 (_("Unknown argument"), optarg);
114 print_usage ();
115 exit (STATE_UNKNOWN);
116 case 'V': /* version */ 114 case 'V': /* version */
117 print_revision (progname, revision); 115 print_revision (progname, revision);
118 exit (STATE_OK); 116 exit (STATE_OK);
@@ -135,7 +133,7 @@ process_arguments (int argc, char **argv)
135#ifdef USE_IPV6 133#ifdef USE_IPV6
136 address_family = AF_INET6; 134 address_family = AF_INET6;
137#else 135#else
138 usage (_("IPv6 support not available\n")); 136 usage4 (_("IPv6 support not available"));
139#endif 137#endif
140 break; 138 break;
141 case 'r': /* remote version */ 139 case 'r': /* remote version */
@@ -151,11 +149,9 @@ process_arguments (int argc, char **argv)
151 port = atoi (optarg); 149 port = atoi (optarg);
152 } 150 }
153 else { 151 else {
154 printf ("Port number nust be a positive integer: %s\n", optarg); 152 usage2 (_("Port number must be a positive integer"), optarg);
155 usage ("");
156 } 153 }
157 } 154 }
158
159 } 155 }
160 156
161 c = optind; 157 c = optind;
diff --git a/plugins/check_swap.c b/plugins/check_swap.c
index 6e2ab72..093845b 100644
--- a/plugins/check_swap.c
+++ b/plugins/check_swap.c
@@ -239,7 +239,7 @@ main (int argc, char **argv)
239 /* and now, tally 'em up */ 239 /* and now, tally 'em up */
240 swapctl_res=swapctl(SC_LIST, tbl); 240 swapctl_res=swapctl(SC_LIST, tbl);
241 if(swapctl_res < 0){ 241 if(swapctl_res < 0){
242 perror("swapctl failed: "); 242 perror(_("swapctl failed: "));
243 result = STATE_WARNING; 243 result = STATE_WARNING;
244 } 244 }
245 245
@@ -278,7 +278,7 @@ main (int argc, char **argv)
278 /* and now, tally 'em up */ 278 /* and now, tally 'em up */
279 swapctl_res=swapctl(SWAP_STATS, ent, nswaps); 279 swapctl_res=swapctl(SWAP_STATS, ent, nswaps);
280 if(swapctl_res < 0){ 280 if(swapctl_res < 0){
281 perror("swapctl failed: "); 281 perror(_("swapctl failed: "));
282 result = STATE_WARNING; 282 result = STATE_WARNING;
283 } 283 }
284 284
@@ -388,7 +388,7 @@ process_arguments (int argc, char **argv)
388 break; 388 break;
389 } 389 }
390 else { 390 else {
391 usage (_("Warning threshold must be integer or percentage!\n")); 391 usage4 (_("Warning threshold must be integer or percentage!"));
392 } 392 }
393 case 'c': /* critical size threshold */ 393 case 'c': /* critical size threshold */
394 if (is_intnonneg (optarg)) { 394 if (is_intnonneg (optarg)) {
@@ -420,9 +420,7 @@ process_arguments (int argc, char **argv)
420 print_help (); 420 print_help ();
421 exit (STATE_OK); 421 exit (STATE_OK);
422 case '?': /* error */ 422 case '?': /* error */
423 printf (_("%s: Unknown argument: %s\n\n"), progname, optarg); 423 usage2 (_("Unknown argument"), optarg);
424 print_usage ();
425 exit (STATE_UNKNOWN);
426 } 424 }
427 } 425 }
428 426
diff --git a/plugins/check_tcp.c b/plugins/check_tcp.c
index b922536..fcd6778 100644
--- a/plugins/check_tcp.c
+++ b/plugins/check_tcp.c
@@ -259,13 +259,13 @@ main (int argc, char **argv)
259#ifdef HAVE_SSL 259#ifdef HAVE_SSL
260 if (use_ssl && check_cert == TRUE) { 260 if (use_ssl && check_cert == TRUE) {
261 if (connect_SSL () != OK) 261 if (connect_SSL () != OK)
262 die (STATE_CRITICAL,"CRITICAL - Could not make SSL connection\n"); 262 die (STATE_CRITICAL,_("CRITICAL - Could not make SSL connection\n"));
263 if ((server_cert = SSL_get_peer_certificate (ssl)) != NULL) { 263 if ((server_cert = SSL_get_peer_certificate (ssl)) != NULL) {
264 result = check_certificate (&server_cert); 264 result = check_certificate (&server_cert);
265 X509_free(server_cert); 265 X509_free(server_cert);
266 } 266 }
267 else { 267 else {
268 printf("CRITICAL - Cannot retrieve server certificate.\n"); 268 printf(_("CRITICAL - Cannot retrieve server certificate.\n"));
269 result = STATE_CRITICAL; 269 result = STATE_CRITICAL;
270 } 270 }
271 SSL_shutdown (ssl); 271 SSL_shutdown (ssl);
@@ -434,7 +434,7 @@ process_arguments (int argc, char **argv)
434 }; 434 };
435 435
436 if (argc < 2) 436 if (argc < 2)
437 usage ("No arguments found\n"); 437 usage4 (_("No arguments found"));
438 438
439 /* backwards compatibility */ 439 /* backwards compatibility */
440 for (c = 1; c < argc; c++) { 440 for (c = 1; c < argc; c++) {
@@ -462,14 +462,12 @@ process_arguments (int argc, char **argv)
462 462
463 switch (c) { 463 switch (c) {
464 case '?': /* print short usage statement if args not parsable */ 464 case '?': /* print short usage statement if args not parsable */
465 printf (_("%s: Unknown argument: %s\n\n"), progname, optarg); 465 usage2 (_("Unknown argument"), optarg);
466 print_usage ();
467 exit (STATE_UNKNOWN);
468 case 'h': /* help */ 466 case 'h': /* help */
469 print_help (); 467 print_help ();
470 exit (STATE_OK); 468 exit (STATE_OK);
471 case 'V': /* version */ 469 case 'V': /* version */
472 print_revision (progname, "$Revision$"); 470 print_revision (progname, revision);
473 exit (STATE_OK); 471 exit (STATE_OK);
474 case 'v': /* verbose mode */ 472 case 'v': /* verbose mode */
475 verbose = TRUE; 473 verbose = TRUE;
@@ -575,7 +573,7 @@ process_arguments (int argc, char **argv)
575 case 'D': /* Check SSL cert validity - days 'til certificate expiration */ 573 case 'D': /* Check SSL cert validity - days 'til certificate expiration */
576#ifdef HAVE_SSL 574#ifdef HAVE_SSL
577 if (!is_intnonneg (optarg)) 575 if (!is_intnonneg (optarg))
578 usage2 ("invalid certificate expiration period", optarg); 576 usage2 (_("Invalid certificate expiration period"), optarg);
579 days_till_exp = atoi (optarg); 577 days_till_exp = atoi (optarg);
580 check_cert = TRUE; 578 check_cert = TRUE;
581 use_ssl = TRUE; 579 use_ssl = TRUE;
@@ -583,14 +581,14 @@ process_arguments (int argc, char **argv)
583 case 'S': 581 case 'S':
584 use_ssl = TRUE; 582 use_ssl = TRUE;
585#else 583#else
586 die (STATE_UNKNOWN, "SSL support not available. Install OpenSSL and recompile."); 584 die (STATE_UNKNOWN, _("SSL support not available. Install OpenSSL and recompile."));
587#endif 585#endif
588 break; 586 break;
589 } 587 }
590 } 588 }
591 589
592 if (server_address == NULL) 590 if (server_address == NULL)
593 usage (_("You must provide a server address\n")); 591 usage4 (_("You must provide a server address"));
594 592
595 return TRUE; 593 return TRUE;
596} 594}
@@ -669,7 +667,7 @@ check_certificate (X509 ** certificate)
669 /* Generate tm structure to process timestamp */ 667 /* Generate tm structure to process timestamp */
670 if (tm->type == V_ASN1_UTCTIME) { 668 if (tm->type == V_ASN1_UTCTIME) {
671 if (tm->length < 10) { 669 if (tm->length < 10) {
672 printf ("CRITICAL - Wrong time format in certificate.\n"); 670 printf (_("CRITICAL - Wrong time format in certificate.\n"));
673 return STATE_CRITICAL; 671 return STATE_CRITICAL;
674 } 672 }
675 else { 673 else {
@@ -681,7 +679,7 @@ check_certificate (X509 ** certificate)
681 } 679 }
682 else { 680 else {
683 if (tm->length < 12) { 681 if (tm->length < 12) {
684 printf ("CRITICAL - Wrong time format in certificate.\n"); 682 printf (_("CRITICAL - Wrong time format in certificate.\n"));
685 return STATE_CRITICAL; 683 return STATE_CRITICAL;
686 } 684 }
687 else { 685 else {
@@ -710,20 +708,20 @@ check_certificate (X509 ** certificate)
710 stamp.tm_mday, stamp.tm_year + 1900, stamp.tm_hour, stamp.tm_min); 708 stamp.tm_mday, stamp.tm_year + 1900, stamp.tm_hour, stamp.tm_min);
711 709
712 if (days_left > 0 && days_left <= days_till_exp) { 710 if (days_left > 0 && days_left <= days_till_exp) {
713 printf ("Certificate expires in %d day(s) (%s).\n", days_left, timestamp); 711 printf (_("Certificate expires in %d day(s) (%s).\n"), days_left, timestamp);
714 return STATE_WARNING; 712 return STATE_WARNING;
715 } 713 }
716 if (days_left < 0) { 714 if (days_left < 0) {
717 printf ("Certificate expired on %s.\n", timestamp); 715 printf (_("Certificate expired on %s.\n"), timestamp);
718 return STATE_CRITICAL; 716 return STATE_CRITICAL;
719 } 717 }
720 718
721 if (days_left == 0) { 719 if (days_left == 0) {
722 printf ("Certificate expires today (%s).\n", timestamp); 720 printf (_("Certificate expires today (%s).\n"), timestamp);
723 return STATE_WARNING; 721 return STATE_WARNING;
724 } 722 }
725 723
726 printf ("Certificate will expire on %s.\n", timestamp); 724 printf (_("Certificate will expire on %s.\n"), timestamp);
727 725
728 return STATE_OK; 726 return STATE_OK;
729} 727}
diff --git a/plugins/check_time.c b/plugins/check_time.c
index 63d7ee2..efca91b 100644
--- a/plugins/check_time.c
+++ b/plugins/check_time.c
@@ -216,9 +216,7 @@ process_arguments (int argc, char **argv)
216 216
217 switch (c) { 217 switch (c) {
218 case '?': /* print short usage statement if args not parsable */ 218 case '?': /* print short usage statement if args not parsable */
219 printf (_("%s: Unknown argument: %s\n\n"), progname, optarg); 219 usage2 (_("Unknown argument"), optarg);
220 print_usage ();
221 exit (STATE_UNKNOWN);
222 case 'h': /* help */ 220 case 'h': /* help */
223 print_help (); 221 print_help ();
224 exit (STATE_OK); 222 exit (STATE_OK);
diff --git a/plugins/check_udp.c b/plugins/check_udp.c
index b79f31f..e7d5280 100644
--- a/plugins/check_udp.c
+++ b/plugins/check_udp.c
@@ -67,7 +67,7 @@ main (int argc, char **argv)
67 time (&end_time); 67 time (&end_time);
68 68
69 if (result != STATE_OK) { 69 if (result != STATE_OK) {
70 printf ("No response from host on port %d\n", server_port); 70 printf (_("No response from host on port %d\n"), server_port);
71 result = STATE_CRITICAL; 71 result = STATE_CRITICAL;
72 } 72 }
73 73
@@ -76,7 +76,7 @@ main (int argc, char **argv)
76 /* check to see if we got the response we wanted */ 76 /* check to see if we got the response we wanted */
77 if (server_expect) { 77 if (server_expect) {
78 if (!strstr (recv_buffer, server_expect)) { 78 if (!strstr (recv_buffer, server_expect)) {
79 printf ("Invalid response received from host on port %d\n", 79 printf (_("Invalid response received from host on port %d\n"),
80 server_port); 80 server_port);
81 result = STATE_CRITICAL; 81 result = STATE_CRITICAL;
82 } 82 }
@@ -146,9 +146,7 @@ process_arguments (int argc, char **argv)
146 146
147 switch (c) { 147 switch (c) {
148 case '?': /* print short usage statement if args not parsable */ 148 case '?': /* print short usage statement if args not parsable */
149 printf (_("%s: Unknown argument: %s\n\n"), progname, optarg); 149 usage2 (_("Unknown argument"), optarg);
150 print_usage ();
151 exit (STATE_UNKNOWN);
152 case 'h': /* help */ 150 case 'h': /* help */
153 print_help (); 151 print_help ();
154 exit (STATE_OK); 152 exit (STATE_OK);
@@ -254,8 +252,6 @@ STATE_CRITICAL, other errors return STATE_UNKNOWN.\n\n"));
254} 252}
255 253
256 254
257
258
259/* Original Command line: 255/* Original Command line:
260 check_udp <host_address> [-p port] [-s send] [-e expect] \ 256 check_udp <host_address> [-p port] [-s send] [-e expect] \
261 [-wt warn_time] [-ct crit_time] [-to to_sec] */ 257 [-wt warn_time] [-ct crit_time] [-to to_sec] */
diff --git a/plugins/check_ups.c b/plugins/check_ups.c
index a4d7650..1cdf9e9 100644
--- a/plugins/check_ups.c
+++ b/plugins/check_ups.c
@@ -133,48 +133,48 @@ main (int argc, char **argv)
133 } 133 }
134 else if ((status & (UPSSTATUS_OB | UPSSTATUS_LB)) == 134 else if ((status & (UPSSTATUS_OB | UPSSTATUS_LB)) ==
135 (UPSSTATUS_OB | UPSSTATUS_LB)) { 135 (UPSSTATUS_OB | UPSSTATUS_LB)) {
136 asprintf (&ups_status, "On Battery, Low Battery"); 136 asprintf (&ups_status, _("On Battery, Low Battery"));
137 result = STATE_CRITICAL; 137 result = STATE_CRITICAL;
138 } 138 }
139 else { 139 else {
140 if (status & UPSSTATUS_OL) { 140 if (status & UPSSTATUS_OL) {
141 asprintf (&ups_status, "%s%s", ups_status, "Online"); 141 asprintf (&ups_status, "%s%s", ups_status, _("Online"));
142 } 142 }
143 if (status & UPSSTATUS_OB) { 143 if (status & UPSSTATUS_OB) {
144 asprintf (&ups_status, "%s%s", ups_status, "On Battery"); 144 asprintf (&ups_status, "%s%s", ups_status, _("On Battery"));
145 result = STATE_WARNING; 145 result = STATE_WARNING;
146 } 146 }
147 if (status & UPSSTATUS_LB) { 147 if (status & UPSSTATUS_LB) {
148 asprintf (&ups_status, "%s%s", ups_status, ", Low Battery"); 148 asprintf (&ups_status, "%s%s", ups_status, _(", Low Battery"));
149 result = STATE_WARNING; 149 result = STATE_WARNING;
150 } 150 }
151 if (status & UPSSTATUS_CAL) { 151 if (status & UPSSTATUS_CAL) {
152 asprintf (&ups_status, "%s%s", ups_status, ", Calibrating"); 152 asprintf (&ups_status, "%s%s", ups_status, _(", Calibrating"));
153 } 153 }
154 if (status & UPSSTATUS_RB) { 154 if (status & UPSSTATUS_RB) {
155 asprintf (&ups_status, "%s%s", ups_status, ", Replace Battery"); 155 asprintf (&ups_status, "%s%s", ups_status, _(", Replace Battery"));
156 result = STATE_WARNING; 156 result = STATE_WARNING;
157 } 157 }
158 if (status & UPSSTATUS_BYPASS) { 158 if (status & UPSSTATUS_BYPASS) {
159 asprintf (&ups_status, "%s%s", ups_status, ", On Bypass"); 159 asprintf (&ups_status, "%s%s", ups_status, _(", On Bypass"));
160 } 160 }
161 if (status & UPSSTATUS_OVER) { 161 if (status & UPSSTATUS_OVER) {
162 asprintf (&ups_status, "%s%s", ups_status, ", Overload"); 162 asprintf (&ups_status, "%s%s", ups_status, _(", Overload"));
163 } 163 }
164 if (status & UPSSTATUS_TRIM) { 164 if (status & UPSSTATUS_TRIM) {
165 asprintf (&ups_status, "%s%s", ups_status, ", Trimming"); 165 asprintf (&ups_status, "%s%s", ups_status, _(", Trimming"));
166 } 166 }
167 if (status & UPSSTATUS_BOOST) { 167 if (status & UPSSTATUS_BOOST) {
168 asprintf (&ups_status, "%s%s", ups_status, ", Boosting"); 168 asprintf (&ups_status, "%s%s", ups_status, _(", Boosting"));
169 } 169 }
170 if (status & UPSSTATUS_CHRG) { 170 if (status & UPSSTATUS_CHRG) {
171 asprintf (&ups_status, "%s%s", ups_status, ", Charging"); 171 asprintf (&ups_status, "%s%s", ups_status, _(", Charging"));
172 } 172 }
173 if (status & UPSSTATUS_DISCHRG) { 173 if (status & UPSSTATUS_DISCHRG) {
174 asprintf (&ups_status, "%s%s", ups_status, ", Discharging"); 174 asprintf (&ups_status, "%s%s", ups_status, _(", Discharging"));
175 } 175 }
176 if (status & UPSSTATUS_UNKOWN) { 176 if (status & UPSSTATUS_UNKOWN) {
177 asprintf (&ups_status, "%s%s", ups_status, ", Unknown"); 177 asprintf (&ups_status, "%s%s", ups_status, _(", Unknown"));
178 } 178 }
179 } 179 }
180 asprintf (&message, "%sStatus=%s ", message, ups_status); 180 asprintf (&message, "%sStatus=%s ", message, ups_status);
@@ -311,7 +311,7 @@ main (int argc, char **argv)
311 /* if the UPS does not support any options we are looking for, report an error */ 311 /* if the UPS does not support any options we are looking for, report an error */
312 if (supported_options == UPS_NONE) { 312 if (supported_options == UPS_NONE) {
313 result = STATE_CRITICAL; 313 result = STATE_CRITICAL;
314 asprintf (&message, "UPS does not support any available options\n"); 314 asprintf (&message, _("UPS does not support any available options\n"));
315 } 315 }
316 316
317 /* reset timeout */ 317 /* reset timeout */
@@ -335,7 +335,7 @@ determine_status (void)
335 res=get_ups_variable ("ups.status", recv_buffer, sizeof (recv_buffer)); 335 res=get_ups_variable ("ups.status", recv_buffer, sizeof (recv_buffer));
336 if (res == NOSUCHVAR) return OK; 336 if (res == NOSUCHVAR) return OK;
337 if (res != STATE_OK) { 337 if (res != STATE_OK) {
338 printf ("Invalid response received from host\n"); 338 printf (_("Invalid response received from host\n"));
339 return ERROR; 339 return ERROR;
340 } 340 }
341 341
@@ -395,7 +395,7 @@ get_ups_variable (const char *varname, char *buf, size_t buflen)
395 if (process_tcp_request 395 if (process_tcp_request
396 (server_address, server_port, send_buffer, temp_buffer, 396 (server_address, server_port, send_buffer, temp_buffer,
397 sizeof (temp_buffer)) != STATE_OK) { 397 sizeof (temp_buffer)) != STATE_OK) {
398 printf ("Invalid response received from host\n"); 398 printf (_("Invalid response received from host\n"));
399 return ERROR; 399 return ERROR;
400 } 400 }
401 401
@@ -403,7 +403,7 @@ get_ups_variable (const char *varname, char *buf, size_t buflen)
403 len = strlen(ptr); 403 len = strlen(ptr);
404 if (len > 0 && ptr[len-1] == '\n') ptr[len-1]=0; 404 if (len > 0 && ptr[len-1] == '\n') ptr[len-1]=0;
405 if (strcmp (ptr, "ERR UNKNOWN-UPS") == 0) { 405 if (strcmp (ptr, "ERR UNKNOWN-UPS") == 0) {
406 printf ("CRITICAL - no such ups '%s' on that host\n", ups_name); 406 printf (_("CRITICAL - no such ups '%s' on that host\n"), ups_name);
407 return ERROR; 407 return ERROR;
408 } 408 }
409 409
@@ -413,19 +413,19 @@ get_ups_variable (const char *varname, char *buf, size_t buflen)
413 } 413 }
414 414
415 if (strcmp (ptr, "ERR DATA-STALE") == 0) { 415 if (strcmp (ptr, "ERR DATA-STALE") == 0) {
416 printf ("CRITICAL - UPS data is stale\n"); 416 printf (_("CRITICAL - UPS data is stale\n"));
417 return ERROR; 417 return ERROR;
418 } 418 }
419 419
420 if (strncmp (ptr, "ERR", 3) == 0) { 420 if (strncmp (ptr, "ERR", 3) == 0) {
421 printf ("Unknown error: %s\n", ptr); 421 printf (_("Unknown error: %s\n"), ptr);
422 return ERROR; 422 return ERROR;
423 } 423 }
424 424
425 ptr = temp_buffer + strlen (varname) + strlen (ups_name) + 6; 425 ptr = temp_buffer + strlen (varname) + strlen (ups_name) + 6;
426 len = strlen(ptr); 426 len = strlen(ptr);
427 if (len < 2 || ptr[0] != '"' || ptr[len-1] != '"') { 427 if (len < 2 || ptr[0] != '"' || ptr[len-1] != '"') {
428 printf ("Error: unable to parse variable\n"); 428 printf (_("Error: unable to parse variable\n"));
429 return ERROR; 429 return ERROR;
430 } 430 }
431 strncpy (buf, ptr+1, len - 2); 431 strncpy (buf, ptr+1, len - 2);
@@ -481,9 +481,7 @@ process_arguments (int argc, char **argv)
481 481
482 switch (c) { 482 switch (c) {
483 case '?': /* help */ 483 case '?': /* help */
484 printf (_("%s: Unknown argument: %s\n\n"), progname, optarg); 484 usage2 (_("Unknown argument"), optarg);
485 print_usage ();
486 exit (STATE_UNKNOWN);
487 case 'H': /* hostname */ 485 case 'H': /* hostname */
488 if (is_host (optarg)) { 486 if (is_host (optarg)) {
489 server_address = optarg; 487 server_address = optarg;
@@ -503,7 +501,7 @@ process_arguments (int argc, char **argv)
503 server_port = atoi (optarg); 501 server_port = atoi (optarg);
504 } 502 }
505 else { 503 else {
506 usage2 ("Port must be a positive integer", optarg); 504 usage2 (_("Port must be a positive integer"), optarg);
507 } 505 }
508 break; 506 break;
509 case 'c': /* critical time threshold */ 507 case 'c': /* critical time threshold */
@@ -512,7 +510,7 @@ process_arguments (int argc, char **argv)
512 check_crit = TRUE; 510 check_crit = TRUE;
513 } 511 }
514 else { 512 else {
515 usage2 ("Critical time must be a positive integer", optarg); 513 usage2 (_("Critical time must be a positive integer"), optarg);
516 } 514 }
517 break; 515 break;
518 case 'w': /* warning time threshold */ 516 case 'w': /* warning time threshold */
@@ -521,7 +519,7 @@ process_arguments (int argc, char **argv)
521 check_warn = TRUE; 519 check_warn = TRUE;
522 } 520 }
523 else { 521 else {
524 usage2 ("Warning time must be a positive integer", optarg); 522 usage2 (_("Warning time must be a positive integer"), optarg);
525 } 523 }
526 break; 524 break;
527 case 'v': /* variable */ 525 case 'v': /* variable */
@@ -534,14 +532,14 @@ process_arguments (int argc, char **argv)
534 else if (!strcmp (optarg, "LOADPCT")) 532 else if (!strcmp (optarg, "LOADPCT"))
535 check_variable = UPS_LOADPCT; 533 check_variable = UPS_LOADPCT;
536 else 534 else
537 usage2 ("Unrecognized UPS variable", optarg); 535 usage2 (_("Unrecognized UPS variable"), optarg);
538 break; 536 break;
539 case 't': /* timeout */ 537 case 't': /* timeout */
540 if (is_intnonneg (optarg)) { 538 if (is_intnonneg (optarg)) {
541 socket_timeout = atoi (optarg); 539 socket_timeout = atoi (optarg);
542 } 540 }
543 else { 541 else {
544 usage ("Time interval must be a positive integer\n"); 542 usage4 (_("Timeout interval must be a positive integer"));
545 } 543 }
546 break; 544 break;
547 case 'V': /* version */ 545 case 'V': /* version */
@@ -568,19 +566,17 @@ process_arguments (int argc, char **argv)
568} 566}
569 567
570 568
571
572int 569int
573validate_arguments (void) 570validate_arguments (void)
574{ 571{
575 if (! ups_name) { 572 if (! ups_name) {
576 printf ("Error : no ups indicated\n"); 573 printf (_("Error : no ups indicated\n"));
577 return ERROR; 574 return ERROR;
578 } 575 }
579 return OK; 576 return OK;
580} 577}
581 578
582 579
583
584void 580void
585print_help (void) 581print_help (void)
586{ 582{
@@ -641,7 +637,6 @@ http://www.networkupstools.org\n\n"));
641} 637}
642 638
643 639
644
645void 640void
646print_usage (void) 641print_usage (void)
647{ 642{
diff --git a/plugins/check_users.c b/plugins/check_users.c
index d1b4f01..25d04ed 100644
--- a/plugins/check_users.c
+++ b/plugins/check_users.c
@@ -140,9 +140,7 @@ process_arguments (int argc, char **argv)
140 140
141 switch (c) { 141 switch (c) {
142 case '?': /* print short usage statement if args not parsable */ 142 case '?': /* print short usage statement if args not parsable */
143 printf (_("%s: Unknown argument: %s\n\n"), progname, optarg); 143 usage2 (_("Unknown argument"), optarg);
144 print_usage ();
145 exit (STATE_UNKNOWN);
146 case 'h': /* help */ 144 case 'h': /* help */
147 print_help (); 145 print_help ();
148 exit (STATE_OK); 146 exit (STATE_OK);
@@ -151,13 +149,13 @@ process_arguments (int argc, char **argv)
151 exit (STATE_OK); 149 exit (STATE_OK);
152 case 'c': /* critical */ 150 case 'c': /* critical */
153 if (!is_intnonneg (optarg)) 151 if (!is_intnonneg (optarg))
154 usage (_("Critical threshold must be a positive integer\n")); 152 usage4 (_("Critical threshold must be a positive integer"));
155 else 153 else
156 cusers = atoi (optarg); 154 cusers = atoi (optarg);
157 break; 155 break;
158 case 'w': /* warning */ 156 case 'w': /* warning */
159 if (!is_intnonneg (optarg)) 157 if (!is_intnonneg (optarg))
160 usage (_("Warning threshold must be a positive integer\n")); 158 usage4 (_("Warning threshold must be a positive integer"));
161 else 159 else
162 wusers = atoi (optarg); 160 wusers = atoi (optarg);
163 break; 161 break;
@@ -167,14 +165,14 @@ process_arguments (int argc, char **argv)
167 c = optind; 165 c = optind;
168 if (wusers == -1 && argc > c) { 166 if (wusers == -1 && argc > c) {
169 if (is_intnonneg (argv[c]) == FALSE) 167 if (is_intnonneg (argv[c]) == FALSE)
170 usage (_("Warning threshold must be a positive integer\n")); 168 usage4 (_("Warning threshold must be a positive integer"));
171 else 169 else
172 wusers = atoi (argv[c++]); 170 wusers = atoi (argv[c++]);
173 } 171 }
174 172
175 if (cusers == -1 && argc > c) { 173 if (cusers == -1 && argc > c) {
176 if (is_intnonneg (argv[c]) == FALSE) 174 if (is_intnonneg (argv[c]) == FALSE)
177 usage (_("Warning threshold must be a positive integer\n")); 175 usage4 (_("Warning threshold must be a positive integer"));
178 else 176 else
179 cusers = atoi (argv[c]); 177 cusers = atoi (argv[c]);
180 } 178 }
@@ -210,7 +208,6 @@ system and generates an error if the number exceeds the thresholds specified.\n"
210} 208}
211 209
212 210
213
214void 211void
215print_usage (void) 212print_usage (void)
216{ 213{
diff --git a/plugins/negate.c b/plugins/negate.c
index e35ddb9..d08c3a3 100644
--- a/plugins/negate.c
+++ b/plugins/negate.c
@@ -174,9 +174,7 @@ process_arguments (int argc, char **argv)
174 174
175 switch (c) { 175 switch (c) {
176 case '?': /* help */ 176 case '?': /* help */
177 printf (_("%s: Unknown argument: %s\n\n"), progname, optarg); 177 usage2 (_("Unknown argument"), optarg);
178 print_usage ();
179 exit (STATE_UNKNOWN);
180 break; 178 break;
181 case 'h': /* help */ 179 case 'h': /* help */
182 print_help (); 180 print_help ();
diff --git a/plugins/netutils.c b/plugins/netutils.c
index 6702b13..1231c1e 100644
--- a/plugins/netutils.c
+++ b/plugins/netutils.c
@@ -45,9 +45,9 @@ void
45socket_timeout_alarm_handler (int sig) 45socket_timeout_alarm_handler (int sig)
46{ 46{
47 if (sig == SIGALRM) 47 if (sig == SIGALRM)
48 printf ("CRITICAL - Socket timeout after %d seconds\n", socket_timeout); 48 printf (_("CRITICAL - Socket timeout after %d seconds\n"), socket_timeout);
49 else 49 else
50 printf ("CRITICAL - Abnormal timeout after %d seconds\n", socket_timeout); 50 printf (_("CRITICAL - Abnormal timeout after %d seconds\n"), socket_timeout);
51 51
52 exit (STATE_CRITICAL); 52 exit (STATE_CRITICAL);
53} 53}
@@ -106,7 +106,7 @@ process_tcp_request2 (const char *server_address, int server_port,
106 106
107 send_result = send (sd, send_buffer, strlen (send_buffer), 0); 107 send_result = send (sd, send_buffer, strlen (send_buffer), 0);
108 if (send_result<0 || (size_t)send_result!=strlen(send_buffer)) { 108 if (send_result<0 || (size_t)send_result!=strlen(send_buffer)) {
109 printf ("Send failed\n"); 109 printf (_("Send failed\n"));
110 result = STATE_WARNING; 110 result = STATE_WARNING;
111 } 111 }
112 112
@@ -123,7 +123,7 @@ process_tcp_request2 (const char *server_address, int server_port,
123 if (!FD_ISSET (sd, &readfds)) { /* it hasn't */ 123 if (!FD_ISSET (sd, &readfds)) { /* it hasn't */
124 if (!recv_length) { 124 if (!recv_length) {
125 strcpy (recv_buffer, ""); 125 strcpy (recv_buffer, "");
126 printf ("No data was received from host!\n"); 126 printf (_("No data was received from host!\n"));
127 result = STATE_WARNING; 127 result = STATE_WARNING;
128 } 128 }
129 else { /* this one failed, but previous ones worked */ 129 else { /* this one failed, but previous ones worked */
@@ -239,7 +239,7 @@ my_connect (const char *host_name, int port, int *sd, int proto)
239 SOCK_DGRAM : SOCK_STREAM, res->ai_protocol); 239 SOCK_DGRAM : SOCK_STREAM, res->ai_protocol);
240 240
241 if (*sd < 0) { 241 if (*sd < 0) {
242 printf ("Socket creation failed\n"); 242 printf (_("Socket creation failed\n"));
243 freeaddrinfo (res); 243 freeaddrinfo (res);
244 return STATE_UNKNOWN; 244 return STATE_UNKNOWN;
245 } 245 }
@@ -315,7 +315,7 @@ send_request (int sd, int proto, const char *send_buffer, char *recv_buffer, int
315 315
316 send_result = send (sd, send_buffer, strlen (send_buffer), 0); 316 send_result = send (sd, send_buffer, strlen (send_buffer), 0);
317 if (send_result<0 || (size_t)send_result!=strlen(send_buffer)) { 317 if (send_result<0 || (size_t)send_result!=strlen(send_buffer)) {
318 printf ("Send failed\n"); 318 printf (_("Send failed\n"));
319 result = STATE_WARNING; 319 result = STATE_WARNING;
320 } 320 }
321 321
@@ -330,7 +330,7 @@ send_request (int sd, int proto, const char *send_buffer, char *recv_buffer, int
330 /* make sure some data has arrived */ 330 /* make sure some data has arrived */
331 if (!FD_ISSET (sd, &readfds)) { 331 if (!FD_ISSET (sd, &readfds)) {
332 strcpy (recv_buffer, ""); 332 strcpy (recv_buffer, "");
333 printf ("No data was received from host!\n"); 333 printf (_("No data was received from host!\n"));
334 result = STATE_WARNING; 334 result = STATE_WARNING;
335 } 335 }
336 336
@@ -339,7 +339,7 @@ send_request (int sd, int proto, const char *send_buffer, char *recv_buffer, int
339 if (recv_result == -1) { 339 if (recv_result == -1) {
340 strcpy (recv_buffer, ""); 340 strcpy (recv_buffer, "");
341 if (proto != IPPROTO_TCP) 341 if (proto != IPPROTO_TCP)
342 printf ("Receive failed\n"); 342 printf (_("Receive failed\n"));
343 result = STATE_WARNING; 343 result = STATE_WARNING;
344 } 344 }
345 else 345 else
diff --git a/plugins/popen.c b/plugins/popen.c
index 94ad583..04eb388 100644
--- a/plugins/popen.c
+++ b/plugins/popen.c
@@ -114,7 +114,7 @@ spopen (const char *cmdstring)
114 argv = malloc (sizeof(char*)*argc); 114 argv = malloc (sizeof(char*)*argc);
115 115
116 if (argv == NULL) { 116 if (argv == NULL) {
117 printf ("Could not malloc argv array in popen()\n"); 117 printf (_("Could not malloc argv array in popen()\n"));
118 return NULL; 118 return NULL;
119 } 119 }
120 120
@@ -124,7 +124,7 @@ spopen (const char *cmdstring)
124 str += strspn (str, " \t\r\n"); /* trim any leading whitespace */ 124 str += strspn (str, " \t\r\n"); /* trim any leading whitespace */
125 125
126 if (i >= argc - 2) { 126 if (i >= argc - 2) {
127 printf ("CRITICAL - You need more args!!!\n"); 127 printf (_("CRITICAL - You need more args!!!\n"));
128 return (NULL); 128 return (NULL);
129 } 129 }
130 130
@@ -239,17 +239,19 @@ static int openmax = 0;
239#define OPEN_MAX_GUESS 256 /* if OPEN_MAX is indeterminate */ 239#define OPEN_MAX_GUESS 256 /* if OPEN_MAX is indeterminate */
240 /* no guarantee this is adequate */ 240 /* no guarantee this is adequate */
241 241
242
242void 243void
243popen_timeout_alarm_handler (int signo) 244popen_timeout_alarm_handler (int signo)
244{ 245{
245 if (signo == SIGALRM) { 246 if (signo == SIGALRM) {
246 kill (childpid[fileno (child_process)], SIGKILL); 247 kill (childpid[fileno (child_process)], SIGKILL);
247 printf ("CRITICAL - Plugin timed out after %d seconds\n", 248 printf (_("CRITICAL - Plugin timed out after %d seconds\n"),
248 timeout_interval); 249 timeout_interval);
249 exit (STATE_CRITICAL); 250 exit (STATE_CRITICAL);
250 } 251 }
251} 252}
252 253
254
253int 255int
254open_max (void) 256open_max (void)
255{ 257{
@@ -259,14 +261,13 @@ open_max (void)
259 if (errno == 0) 261 if (errno == 0)
260 openmax = OPEN_MAX_GUESS; /* it's indeterminate */ 262 openmax = OPEN_MAX_GUESS; /* it's indeterminate */
261 else 263 else
262 err_sys ("sysconf error for _SC_OPEN_MAX"); 264 err_sys (_("sysconf error for _SC_OPEN_MAX"));
263 } 265 }
264 } 266 }
265 return (openmax); 267 return (openmax);
266} 268}
267 269
268 270
269
270/* Fatal error related to a system call. 271/* Fatal error related to a system call.
271 * Print a message and die. */ 272 * Print a message and die. */
272 273
@@ -309,4 +310,3 @@ rtrim (char *str, const char *tok)
309 } 310 }
310 return str; 311 return str;
311} 312}
312
diff --git a/plugins/popen.h b/plugins/popen.h
index b758579..1f4e413 100644
--- a/plugins/popen.h
+++ b/plugins/popen.h
@@ -1,3 +1,9 @@
1/******************************************************************************
2 *
3 * $Id$
4 *
5 ******************************************************************************/
6
1FILE *spopen (const char *); 7FILE *spopen (const char *);
2int spclose (FILE *); 8int spclose (FILE *);
3RETSIGTYPE popen_timeout_alarm_handler (int); 9RETSIGTYPE popen_timeout_alarm_handler (int);
diff --git a/plugins/urlize.c b/plugins/urlize.c
index 3564e46..96bbdc0 100644
--- a/plugins/urlize.c
+++ b/plugins/urlize.c
@@ -71,9 +71,7 @@ main (int argc, char **argv)
71 break; 71 break;
72 case '?': 72 case '?':
73 default: 73 default:
74 printf (_("%s: Unknown argument: %s\n\n"), progname, optarg); 74 usage2 (_("Unknown argument"), optarg);
75 print_usage ();
76 exit (STATE_UNKNOWN);
77 } 75 }
78 } 76 }
79 77
diff --git a/plugins/utils.c b/plugins/utils.c
index b2948e6..b9a19d3 100644
--- a/plugins/utils.c
+++ b/plugins/utils.c
@@ -53,7 +53,7 @@ max_state (int a, int b)
53 53
54void usage (const char *msg) 54void usage (const char *msg)
55{ 55{
56 printf ("%s", msg); 56 printf ("%s\n", msg);
57 print_usage (); 57 print_usage ();
58 exit (STATE_UNKNOWN); 58 exit (STATE_UNKNOWN);
59} 59}
@@ -133,7 +133,7 @@ void
133timeout_alarm_handler (int signo) 133timeout_alarm_handler (int signo)
134{ 134{
135 if (signo == SIGALRM) { 135 if (signo == SIGALRM) {
136 printf ("CRITICAL - Plugin timed out after %d seconds\n", 136 printf (_("CRITICAL - Plugin timed out after %d seconds\n"),
137 timeout_interval); 137 timeout_interval);
138 exit (STATE_CRITICAL); 138 exit (STATE_CRITICAL);
139 } 139 }
@@ -430,7 +430,7 @@ strpcpy (char *dest, const char *src, const char *str)
430 if (dest == NULL || strlen (dest) < len) 430 if (dest == NULL || strlen (dest) < len)
431 dest = realloc (dest, len + 1); 431 dest = realloc (dest, len + 1);
432 if (dest == NULL) 432 if (dest == NULL)
433 die (STATE_UNKNOWN, "failed realloc in strpcpy\n"); 433 die (STATE_UNKNOWN, _("failed realloc in strpcpy\n"));
434 434
435 strncpy (dest, src, len); 435 strncpy (dest, src, len);
436 dest[len] = '\0'; 436 dest[len] = '\0';
@@ -472,7 +472,7 @@ strpcat (char *dest, const char *src, const char *str)
472 472
473 dest = realloc (dest, len + l2 + 1); 473 dest = realloc (dest, len + l2 + 1);
474 if (dest == NULL) 474 if (dest == NULL)
475 die (STATE_UNKNOWN, "failed malloc in strscat\n"); 475 die (STATE_UNKNOWN, _("failed malloc in strscat\n"));
476 476
477 strncpy (dest + len, src, l2); 477 strncpy (dest + len, src, l2);
478 dest[len + l2] = '\0'; 478 dest[len + l2] = '\0';