diff options
author | Benoit Mortier <opensides@users.sourceforge.net> | 2004-12-03 16:56:27 +0000 |
---|---|---|
committer | Benoit Mortier <opensides@users.sourceforge.net> | 2004-12-03 16:56:27 +0000 |
commit | 2ad398d2e04717ce3a6a8fb869e855c42581a30a (patch) | |
tree | a9230435f6a718f6b52e0c909846557bf19ce6b5 /plugins | |
parent | fa002886e390f5cc603021e422be3c319a1040ea (diff) | |
download | monitoring-plugins-2ad398d2e04717ce3a6a8fb869e855c42581a30a.tar.gz |
fixes for internationalization
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@990 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/check_load.c | 1 | ||||
-rw-r--r-- | plugins/check_pgsql.c | 13 | ||||
-rw-r--r-- | plugins/check_ping.c | 20 | ||||
-rw-r--r-- | plugins/check_procs.c | 136 | ||||
-rw-r--r-- | plugins/check_radius.c | 2 | ||||
-rw-r--r-- | plugins/check_real.c | 3 | ||||
-rw-r--r-- | plugins/check_smtp.c | 2 | ||||
-rw-r--r-- | plugins/check_snmp.c | 7 | ||||
-rw-r--r-- | plugins/check_ssh.c | 6 | ||||
-rw-r--r-- | plugins/check_swap.c | 9 | ||||
-rw-r--r-- | plugins/check_tcp.c | 8 | ||||
-rw-r--r-- | plugins/check_time.c | 5 | ||||
-rw-r--r-- | plugins/check_udp.c | 9 | ||||
-rw-r--r-- | plugins/check_ups.c | 6 | ||||
-rw-r--r-- | plugins/check_users.c | 3 | ||||
-rw-r--r-- | plugins/urlize.c | 4 |
16 files changed, 118 insertions, 116 deletions
diff --git a/plugins/check_load.c b/plugins/check_load.c index 00bfc8a6..6d87237f 100644 --- a/plugins/check_load.c +++ b/plugins/check_load.c | |||
@@ -321,5 +321,6 @@ print_usage (void) | |||
321 | { | 321 | { |
322 | printf ("Usage: %s -w WLOAD1,WLOAD5,WLOAD15 -c CLOAD1,CLOAD5,CLOAD15\n"), | 322 | printf ("Usage: %s -w WLOAD1,WLOAD5,WLOAD15 -c CLOAD1,CLOAD5,CLOAD15\n"), |
323 | progname); | 323 | progname); |
324 | |||
324 | printf (UT_HLP_VRS, progname, progname); | 325 | printf (UT_HLP_VRS, progname, progname); |
325 | } | 326 | } |
diff --git a/plugins/check_pgsql.c b/plugins/check_pgsql.c index 826a1057..f97ef66c 100644 --- a/plugins/check_pgsql.c +++ b/plugins/check_pgsql.c | |||
@@ -441,12 +441,9 @@ a password, but no effort is made to obsure or encrypt the password.\n")); | |||
441 | void | 441 | void |
442 | print_usage (void) | 442 | print_usage (void) |
443 | { | 443 | { |
444 | printf (S_("\ | 444 | printf ("\ |
445 | Usage:\n %s [-H <host>] [-P <port>] [-c <critical time>] [-w <warning time>]\n\ | 445 | Usage: %s [-H <host>] [-P <port>] [-c <critical time>] [-w <warning time>]\n\ |
446 | [-t <timeout>]"), progname); | 446 | [-t <timeout>] [-d <database>] [-l <logname>] [-p <password>]\n", progname); |
447 | printf (S_("[-d <database>] [-l <logname>] [-p <password>]\n")); | 447 | |
448 | printf (S_("\ | 448 | printf (UT_HLP_VRS, progname, progname); |
449 | %s (-h | --help) for detailed help\n\ | ||
450 | %s (-V | --version) for version information\n"), | ||
451 | progname, progname); | ||
452 | } | 449 | } |
diff --git a/plugins/check_ping.c b/plugins/check_ping.c index 132453d2..c04fb027 100644 --- a/plugins/check_ping.c +++ b/plugins/check_ping.c | |||
@@ -485,17 +485,6 @@ error_scan (char buf[MAX_INPUT_BUFFER], const char *addr) | |||
485 | 485 | ||
486 | 486 | ||
487 | void | 487 | void |
488 | print_usage (void) | ||
489 | { | ||
490 | printf (\ | ||
491 | "Usage: %s -H <host_address> -w <wrta>,<wpl>%% -c <crta>,<cpl>%%\n\ | ||
492 | [-p packets] [-t timeout] [-L] [-4|-6]\n", progname); | ||
493 | printf (_(UT_HLP_VRS), progname, progname); | ||
494 | } | ||
495 | |||
496 | |||
497 | |||
498 | void | ||
499 | print_help (void) | 488 | print_help (void) |
500 | { | 489 | { |
501 | print_revision (progname, revision); | 490 | print_revision (progname, revision); |
@@ -539,3 +528,12 @@ the contrib area of the downloads section at http://www.nagios.org\n\n")); | |||
539 | 528 | ||
540 | printf (_(UT_SUPPORT)); | 529 | printf (_(UT_SUPPORT)); |
541 | } | 530 | } |
531 | |||
532 | void | ||
533 | print_usage (void) | ||
534 | { | ||
535 | printf ("Usage: %s -H <host_address> -w <wrta>,<wpl>%% -c <crta>,<cpl>%%\n\ | ||
536 | [-p packets] [-t timeout] [-L] [-4|-6]\n", progname); | ||
537 | |||
538 | printf (UT_HLP_VRS, progname, progname); | ||
539 | } | ||
diff --git a/plugins/check_procs.c b/plugins/check_procs.c index a8a7d5e8..ee168db2 100644 --- a/plugins/check_procs.c +++ b/plugins/check_procs.c | |||
@@ -589,6 +589,71 @@ check_thresholds (int value) | |||
589 | 589 | ||
590 | 590 | ||
591 | 591 | ||
592 | |||
593 | /* convert the elapsed time to seconds */ | ||
594 | int | ||
595 | convert_to_seconds(char *etime) { | ||
596 | |||
597 | char *ptr; | ||
598 | int total; | ||
599 | |||
600 | int hyphcnt; | ||
601 | int coloncnt; | ||
602 | int days; | ||
603 | int hours; | ||
604 | int minutes; | ||
605 | int seconds; | ||
606 | |||
607 | hyphcnt = 0; | ||
608 | coloncnt = 0; | ||
609 | days = 0; | ||
610 | hours = 0; | ||
611 | minutes = 0; | ||
612 | seconds = 0; | ||
613 | |||
614 | for (ptr = etime; *ptr != '\0'; ptr++) { | ||
615 | |||
616 | if (*ptr == '-') { | ||
617 | hyphcnt++; | ||
618 | continue; | ||
619 | } | ||
620 | if (*ptr == ':') { | ||
621 | coloncnt++; | ||
622 | continue; | ||
623 | } | ||
624 | } | ||
625 | |||
626 | if (hyphcnt > 0) { | ||
627 | sscanf(etime, "%d-%d:%d:%d", | ||
628 | &days, &hours, &minutes, &seconds); | ||
629 | /* linux 2.6.5/2.6.6 reporting some processes with infinite | ||
630 | * elapsed times for some reason */ | ||
631 | if (days == 49710) { | ||
632 | return 0; | ||
633 | } | ||
634 | } else { | ||
635 | if (coloncnt == 2) { | ||
636 | sscanf(etime, "%d:%d:%d", | ||
637 | &hours, &minutes, &seconds); | ||
638 | } else if (coloncnt == 1) { | ||
639 | sscanf(etime, "%d:%d", | ||
640 | &minutes, &seconds); | ||
641 | } | ||
642 | } | ||
643 | |||
644 | total = (days * 86400) + | ||
645 | (hours * 3600) + | ||
646 | (minutes * 60) + | ||
647 | seconds; | ||
648 | |||
649 | if (verbose >= 3) { | ||
650 | printf("seconds: %d\n", total); | ||
651 | } | ||
652 | return total; | ||
653 | } | ||
654 | |||
655 | |||
656 | |||
592 | void | 657 | void |
593 | print_help (void) | 658 | print_help (void) |
594 | { | 659 | { |
@@ -681,78 +746,13 @@ Examples:\n\ | |||
681 | printf (_(UT_SUPPORT)); | 746 | printf (_(UT_SUPPORT)); |
682 | } | 747 | } |
683 | 748 | ||
684 | |||
685 | |||
686 | /* convert the elapsed time to seconds */ | ||
687 | int | ||
688 | convert_to_seconds(char *etime) { | ||
689 | |||
690 | char *ptr; | ||
691 | int total; | ||
692 | |||
693 | int hyphcnt; | ||
694 | int coloncnt; | ||
695 | int days; | ||
696 | int hours; | ||
697 | int minutes; | ||
698 | int seconds; | ||
699 | |||
700 | hyphcnt = 0; | ||
701 | coloncnt = 0; | ||
702 | days = 0; | ||
703 | hours = 0; | ||
704 | minutes = 0; | ||
705 | seconds = 0; | ||
706 | |||
707 | for (ptr = etime; *ptr != '\0'; ptr++) { | ||
708 | |||
709 | if (*ptr == '-') { | ||
710 | hyphcnt++; | ||
711 | continue; | ||
712 | } | ||
713 | if (*ptr == ':') { | ||
714 | coloncnt++; | ||
715 | continue; | ||
716 | } | ||
717 | } | ||
718 | |||
719 | if (hyphcnt > 0) { | ||
720 | sscanf(etime, "%d-%d:%d:%d", | ||
721 | &days, &hours, &minutes, &seconds); | ||
722 | /* linux 2.6.5/2.6.6 reporting some processes with infinite | ||
723 | * elapsed times for some reason */ | ||
724 | if (days == 49710) { | ||
725 | return 0; | ||
726 | } | ||
727 | } else { | ||
728 | if (coloncnt == 2) { | ||
729 | sscanf(etime, "%d:%d:%d", | ||
730 | &hours, &minutes, &seconds); | ||
731 | } else if (coloncnt == 1) { | ||
732 | sscanf(etime, "%d:%d", | ||
733 | &minutes, &seconds); | ||
734 | } | ||
735 | } | ||
736 | |||
737 | total = (days * 86400) + | ||
738 | (hours * 3600) + | ||
739 | (minutes * 60) + | ||
740 | seconds; | ||
741 | |||
742 | if (verbose >= 3) { | ||
743 | printf("seconds: %d\n", total); | ||
744 | } | ||
745 | return total; | ||
746 | } | ||
747 | |||
748 | void | 749 | void |
749 | print_usage (void) | 750 | print_usage (void) |
750 | { | 751 | { |
751 | printf ("\ | 752 | printf ("\ |
752 | Usage: %s -w <range> -c <range> [-m metric] [-s state] [-p ppid]\n\ | 753 | Usage: %s -w <range> -c <range> [-m metric] [-s state] [-p ppid]\n\ |
753 | [-u user] [-r rss] [-z vsz] [-P %%cpu] [-a argument-array]\n\ | 754 | [-u user] [-r rss] [-z vsz] [-P %%cpu] [-a argument-array]\n\ |
754 | [-C command] [-t timeout] [-v]\n", progname); | 755 | [-C command] [-t timeout] [-v]\n", progname); |
755 | printf (_(UT_HLP_VRS), progname, progname); | 756 | |
757 | printf (UT_HLP_VRS, progname, progname); | ||
756 | } | 758 | } |
757 | |||
758 | |||
diff --git a/plugins/check_radius.c b/plugins/check_radius.c index 57a3e407..54746144 100644 --- a/plugins/check_radius.c +++ b/plugins/check_radius.c | |||
@@ -336,5 +336,5 @@ print_usage (void) | |||
336 | printf ("\ | 336 | printf ("\ |
337 | Usage: %s -H host -F config_file -u username -p password [-n nas-id] [-P port]\n\ | 337 | Usage: %s -H host -F config_file -u username -p password [-n nas-id] [-P port]\n\ |
338 | [-t timeout] [-r retries] [-e expect]\n", progname); | 338 | [-t timeout] [-r retries] [-e expect]\n", progname); |
339 | printf (_(UT_HLP_VRS), progname, progname); | 339 | printf (UT_HLP_VRS, progname, progname); |
340 | } | 340 | } |
diff --git a/plugins/check_real.c b/plugins/check_real.c index 8a12a3e5..8df68d90 100644 --- a/plugins/check_real.c +++ b/plugins/check_real.c | |||
@@ -439,5 +439,6 @@ print_usage (void) | |||
439 | printf ("\ | 439 | printf ("\ |
440 | Usage: %s -H host [-e expect] [-p port] [-w warn] [-c crit]\n\ | 440 | Usage: %s -H host [-e expect] [-p port] [-w warn] [-c crit]\n\ |
441 | [-t timeout] [-v]\n", progname); | 441 | [-t timeout] [-v]\n", progname); |
442 | printf (_(UT_HLP_VRS), progname, progname); | 442 | |
443 | printf (UT_HLP_VRS, progname, progname); | ||
443 | } | 444 | } |
diff --git a/plugins/check_smtp.c b/plugins/check_smtp.c index c0ddc703..748edfca 100644 --- a/plugins/check_smtp.c +++ b/plugins/check_smtp.c | |||
@@ -469,5 +469,5 @@ print_usage (void) | |||
469 | printf ("\ | 469 | printf ("\ |
470 | Usage: %s -H host [-p port] [-e expect] [-C command] [-f from addr]\n\ | 470 | Usage: %s -H host [-p port] [-e expect] [-C command] [-f from addr]\n\ |
471 | [-w warn] [-c crit] [-t timeout] [-n] [-v] [-4|-6]\n", progname); | 471 | [-w warn] [-c crit] [-t timeout] [-n] [-v] [-4|-6]\n", progname); |
472 | printf (_(UT_HLP_VRS), progname, progname); | 472 | printf (UT_HLP_VRS, progname, progname); |
473 | } | 473 | } |
diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c index 2e9ea63c..ca6d7a37 100644 --- a/plugins/check_snmp.c +++ b/plugins/check_snmp.c | |||
@@ -948,12 +948,13 @@ Check status of remote machines and obtain sustem information via SNMP\n\n")); | |||
948 | void | 948 | void |
949 | print_usage (void) | 949 | print_usage (void) |
950 | { | 950 | { |
951 | printf (_("\ | 951 | printf ("\ |
952 | Usage: %s -H <ip_address> -o <OID> [-w warn_range] [-c crit_range] \n\ | 952 | Usage: %s -H <ip_address> -o <OID> [-w warn_range] [-c crit_range] \n\ |
953 | [-C community] [-s string] [-r regex] [-R regexi] [-t timeout]\n\ | 953 | [-C community] [-s string] [-r regex] [-R regexi] [-t timeout]\n\ |
954 | [-l label] [-u units] [-p port-number] [-d delimiter]\n\ | 954 | [-l label] [-u units] [-p port-number] [-d delimiter]\n\ |
955 | [-D output-delimiter] [-m miblist] [-P snmp version]\n\ | 955 | [-D output-delimiter] [-m miblist] [-P snmp version]\n\ |
956 | [-L seclevel] [-U secname] [-a authproto] [-A authpasswd]\n\ | 956 | [-L seclevel] [-U secname] [-a authproto] [-A authpasswd]\n\ |
957 | [-X privpasswd]\n"), progname); | 957 | [-X privpasswd]\n", progname); |
958 | printf (_(UT_HLP_VRS), progname, progname); | 958 | |
959 | printf (UT_HLP_VRS, progname, progname); | ||
959 | } | 960 | } |
diff --git a/plugins/check_ssh.c b/plugins/check_ssh.c index a21d64a4..a21e2f52 100644 --- a/plugins/check_ssh.c +++ b/plugins/check_ssh.c | |||
@@ -287,9 +287,9 @@ print_help (void) | |||
287 | void | 287 | void |
288 | print_usage (void) | 288 | print_usage (void) |
289 | { | 289 | { |
290 | printf (_("\ | 290 | printf ("\ |
291 | Usage: %s [-46] [-t <timeout>] [-r <remote version>] [-p <port>] <host>\n"), progname); | 291 | Usage: %s [-46] [-t <timeout>] [-r <remote version>] [-p <port>] <host>\n"), progname); |
292 | printf (_(UT_HLP_VRS), progname, progname); | 292 | |
293 | printf (UT_HLP_VRS, progname, progname); | ||
293 | } | 294 | } |
294 | 295 | ||
295 | /* end of check_ssh.c */ | ||
diff --git a/plugins/check_swap.c b/plugins/check_swap.c index 6857a01b..6a448e10 100644 --- a/plugins/check_swap.c +++ b/plugins/check_swap.c | |||
@@ -514,10 +514,9 @@ On AIX, if -a is specified, uses lsps -a, otherwise uses lsps -s.\n")); | |||
514 | void | 514 | void |
515 | print_usage (void) | 515 | print_usage (void) |
516 | { | 516 | { |
517 | printf (_("Usage:\n\ | 517 | printf ("Usage:\n\ |
518 | %s [-av] -w <percent_free>%% -c <percent_free>%%\n\ | 518 | %s [-av] -w <percent_free>%% -c <percent_free>%%\n\ |
519 | %s [-av] -w <bytes_free> -c <bytes_free>\n\ | 519 | %s [-av] -w <bytes_free> -c <bytes_free>\n", progname, progname); |
520 | %s (-h | --help) for detailed help\n\ | 520 | |
521 | %s (-V | --version) for version information\n"), | 521 | printf (UT_HLP_VRS, progname, progname); |
522 | progname, progname, progname, progname); | ||
523 | } | 522 | } |
diff --git a/plugins/check_tcp.c b/plugins/check_tcp.c index 05737764..405a7629 100644 --- a/plugins/check_tcp.c +++ b/plugins/check_tcp.c | |||
@@ -793,12 +793,12 @@ print_help (void) | |||
793 | void | 793 | void |
794 | print_usage (void) | 794 | print_usage (void) |
795 | { | 795 | { |
796 | printf (_("\ | 796 | printf ("\ |
797 | Usage: %s -H host -p port [-w <warning time>] [-c <critical time>]\n\ | 797 | Usage: %s -H host -p port [-w <warning time>] [-c <critical time>]\n\ |
798 | [-s <send string>] [-e <expect string>] [-q <quit string>]\n\ | 798 | [-s <send string>] [-e <expect string>] [-q <quit string>]\n\ |
799 | [-m <maximum bytes>] [-d <delay>] [-t <timeout seconds>]\n\ | 799 | [-m <maximum bytes>] [-d <delay>] [-t <timeout seconds>]\n\ |
800 | [-r <refuse state>] [-v] [-4|-6] [-j] [-D <days to cert expiry>]\n\ | 800 | [-r <refuse state>] [-v] [-4|-6] [-j] [-D <days to cert expiry>]\n\ |
801 | [-S <use SSL>]\n"), progname); | 801 | [-S <use SSL>]\n", progname); |
802 | printf (" %s (-h|--help)\n", progname); | 802 | |
803 | printf (" %s (-V|--version)\n", progname); | 803 | printf (UT_HLP_VRS, progname, progname); |
804 | } | 804 | } |
diff --git a/plugins/check_time.c b/plugins/check_time.c index 8381fb2f..94c33b6c 100644 --- a/plugins/check_time.c +++ b/plugins/check_time.c | |||
@@ -357,8 +357,9 @@ This plugin will check the time on the specified host.\n\n")); | |||
357 | void | 357 | void |
358 | print_usage (void) | 358 | print_usage (void) |
359 | { | 359 | { |
360 | printf (_("\ | 360 | printf ("\ |
361 | Usage: %s -H <host_address> [-p port] [-u] [-w variance] [-c variance]\n\ | 361 | Usage: %s -H <host_address> [-p port] [-u] [-w variance] [-c variance]\n\ |
362 | [-W connect_time] [-C connect_time] [-t timeout]\n"), progname); | 362 | [-W connect_time] [-C connect_time] [-t timeout]\n", progname); |
363 | |||
363 | printf (_(UT_HLP_VRS), progname, progname); | 364 | printf (_(UT_HLP_VRS), progname, progname); |
364 | } | 365 | } |
diff --git a/plugins/check_udp.c b/plugins/check_udp.c index 5adf23c4..6551ed40 100644 --- a/plugins/check_udp.c +++ b/plugins/check_udp.c | |||
@@ -225,7 +225,7 @@ print_help (void) | |||
225 | printf (COPYRIGHT, copyright, email); | 225 | printf (COPYRIGHT, copyright, email); |
226 | 226 | ||
227 | printf (_("\ | 227 | printf (_("\ |
228 | This plugin tests an UDP connection with the specified host.\n\n")); | 228 | This plugin tests an UDP connection with the specified host.\n\n")); |
229 | 229 | ||
230 | print_usage (); | 230 | print_usage (); |
231 | 231 | ||
@@ -262,8 +262,9 @@ STATE_CRITICAL, other errors return STATE_UNKNOWN.\n\n")); | |||
262 | void | 262 | void |
263 | print_usage (void) | 263 | print_usage (void) |
264 | { | 264 | { |
265 | printf (_("\ | 265 | printf ("\ |
266 | Usage: %s -H <host_address> [-p port] [-w warn_time] [-c crit_time]\n\ | 266 | Usage: %s -H <host_address> [-p port] [-w warn_time] [-c crit_time]\n\ |
267 | [-e expect] [-s send] [-t to_sec] [-v]\n"), progname); | 267 | [-e expect] [-s send] [-t to_sec] [-v]\n", progname); |
268 | printf (_(UT_HLP_VRS), progname, progname); | 268 | |
269 | printf (UT_HLP_VRS, progname, progname); | ||
269 | } | 270 | } |
diff --git a/plugins/check_ups.c b/plugins/check_ups.c index 3e538bca..ee373cbd 100644 --- a/plugins/check_ups.c +++ b/plugins/check_ups.c | |||
@@ -647,8 +647,8 @@ http://www.networkupstools.org\n\n")); | |||
647 | void | 647 | void |
648 | print_usage (void) | 648 | print_usage (void) |
649 | { | 649 | { |
650 | printf (_("\ | 650 | printf ("\ |
651 | Usage: %s -H host -u ups [-p port] [-v variable]\n\ | 651 | Usage: %s -H host -u ups [-p port] [-v variable]\n\ |
652 | [-wv warn_value] [-cv crit_value] [-to to_sec] [-T]\n"), progname); | 652 | [-wv warn_value] [-cv crit_value] [-to to_sec] [-T]\n", progname); |
653 | printf (_(UT_HLP_VRS), progname, progname); | 653 | printf (UT_HLP_VRS, progname, progname); |
654 | } | 654 | } |
diff --git a/plugins/check_users.c b/plugins/check_users.c index d0893225..05ef86fd 100644 --- a/plugins/check_users.c +++ b/plugins/check_users.c | |||
@@ -215,5 +215,6 @@ void | |||
215 | print_usage (void) | 215 | print_usage (void) |
216 | { | 216 | { |
217 | printf ("Usage: %s -w <users> -c <users>\n", progname); | 217 | printf ("Usage: %s -w <users> -c <users>\n", progname); |
218 | printf (_(UT_HLP_VRS), progname, progname); | 218 | |
219 | printf (UT_HLP_VRS, progname, progname); | ||
219 | } | 220 | } |
diff --git a/plugins/urlize.c b/plugins/urlize.c index 65a7b3dd..e1d02ef8 100644 --- a/plugins/urlize.c +++ b/plugins/urlize.c | |||
@@ -162,5 +162,7 @@ You probably want:\n\ | |||
162 | void | 162 | void |
163 | print_usage (void) | 163 | print_usage (void) |
164 | { | 164 | { |
165 | printf (_("Usage:\n %s <url> <plugin> <arg1> ... <argN>\n"), progname); | 165 | printf ("Usage:\n %s <url> <plugin> <arg1> ... <argN>\n", progname); |
166 | |||
167 | printf (UT_HLP_VRS, progname, progname); | ||
166 | } | 168 | } |