summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl DeBisschop <kdebisschop@users.sourceforge.net>2003-08-22 06:22:38 +0000
committerKarl DeBisschop <kdebisschop@users.sourceforge.net>2003-08-22 06:22:38 +0000
commit22bd672d19c378f1e6124ee18e64e5a88cf53739 (patch)
tree127016323f2f3059819f75adb5568a00a0431fc2
parentd35f99c8a9f546a0f02f09ad3f722f66322e813d (diff)
downloadmonitoring-plugins-22bd672d19c378f1e6124ee18e64e5a88cf53739.tar.gz
- bindtextdomain for gettext, a few other smale cleanups here and there
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@690 f882894a-f735-0410-b71e-b25c423dba1c
-rw-r--r--plugins/check_by_ssh.c35
-rw-r--r--plugins/check_dig.c10
-rw-r--r--plugins/check_disk.c4
-rw-r--r--plugins/check_dns.c5
-rw-r--r--plugins/check_dummy.c4
-rw-r--r--plugins/check_fping.c4
-rw-r--r--plugins/check_game.c4
-rw-r--r--plugins/check_hpjd.c5
-rw-r--r--plugins/check_http.c2
-rw-r--r--plugins/check_ide-smart.c4
-rw-r--r--plugins/check_ldap.c4
-rw-r--r--plugins/check_load.c4
-rw-r--r--plugins/check_mrtg.c4
-rw-r--r--plugins/check_mysql.c4
-rw-r--r--plugins/check_nagios.c4
-rw-r--r--plugins/check_nt.c4
-rw-r--r--plugins/check_nwstat.c4
-rw-r--r--plugins/check_overcr.c4
-rw-r--r--plugins/check_pgsql.c4
-rw-r--r--plugins/check_ping.c4
-rw-r--r--plugins/check_procs.c4
-rw-r--r--plugins/check_radius.c4
-rw-r--r--plugins/check_real.c4
-rw-r--r--plugins/check_smtp.c4
-rw-r--r--plugins/check_snmp.c7
-rw-r--r--plugins/check_ssh.c4
-rw-r--r--plugins/check_swap.c10
-rw-r--r--plugins/check_tcp.c6
-rw-r--r--plugins/check_time.c4
-rw-r--r--plugins/check_udp.c4
-rw-r--r--plugins/check_ups.c6
-rw-r--r--plugins/check_users.c4
-rw-r--r--plugins/negate.c4
-rw-r--r--plugins/urlize.c4
34 files changed, 158 insertions, 28 deletions
diff --git a/plugins/check_by_ssh.c b/plugins/check_by_ssh.c
index b0aa1897..560ae0c6 100644
--- a/plugins/check_by_ssh.c
+++ b/plugins/check_by_ssh.c
@@ -42,11 +42,6 @@ char **service;
42int passive = FALSE; 42int passive = FALSE;
43int verbose = FALSE; 43int verbose = FALSE;
44 44
45
46
47
48
49
50int 45int
51main (int argc, char **argv) 46main (int argc, char **argv)
52{ 47{
@@ -61,8 +56,13 @@ main (int argc, char **argv)
61 time_t local_time; 56 time_t local_time;
62 FILE *fp = NULL; 57 FILE *fp = NULL;
63 58
64 asprintf (&remotecmd, "%s", ""); 59 remotecmd = strdup ("");
65 asprintf (&comm, "%s", SSH_COMMAND); 60 comm = strdup (SSH_COMMAND);
61 result_text = strdup ("");
62
63 setlocale (LC_ALL, "");
64 bindtextdomain (PACKAGE, LOCALEDIR);
65 textdomain (PACKAGE);
66 66
67 /* process arguments */ 67 /* process arguments */
68 if (process_arguments (argc, argv) == ERROR) 68 if (process_arguments (argc, argv) == ERROR)
@@ -71,7 +71,7 @@ main (int argc, char **argv)
71 71
72 /* Set signal handling and alarm timeout */ 72 /* Set signal handling and alarm timeout */
73 if (signal (SIGALRM, popen_timeout_alarm_handler) == SIG_ERR) { 73 if (signal (SIGALRM, popen_timeout_alarm_handler) == SIG_ERR) {
74 printf ("Cannot catch SIGALRM"); 74 printf (_("Cannot catch SIGALRM"));
75 return STATE_UNKNOWN; 75 return STATE_UNKNOWN;
76 } 76 }
77 alarm (timeout_interval); 77 alarm (timeout_interval);
@@ -97,7 +97,7 @@ main (int argc, char **argv)
97 } 97 }
98 98
99 99
100 /* get results from remote command */ 100 /* build up results from remote command in result_text */
101 while (fgets (input_buffer, MAX_INPUT_BUFFER - 1, child_process)) 101 while (fgets (input_buffer, MAX_INPUT_BUFFER - 1, child_process))
102 asprintf (&result_text, "%s%s", result_text, input_buffer); 102 asprintf (&result_text, "%s%s", result_text, input_buffer);
103 103
@@ -105,6 +105,8 @@ main (int argc, char **argv)
105 /* WARNING if output found on stderr */ 105 /* WARNING if output found on stderr */
106 if (fgets (input_buffer, MAX_INPUT_BUFFER - 1, child_stderr)) { 106 if (fgets (input_buffer, MAX_INPUT_BUFFER - 1, child_stderr)) {
107 printf ("%s\n", input_buffer); 107 printf ("%s\n", input_buffer);
108 while (fgets (input_buffer, MAX_INPUT_BUFFER - 1, child_process))
109 printf ("%s\n", input_buffer);
108 return STATE_WARNING; 110 return STATE_WARNING;
109 } 111 }
110 (void) fclose (child_stderr); 112 (void) fclose (child_stderr);
@@ -122,10 +124,10 @@ main (int argc, char **argv)
122 exit (STATE_UNKNOWN); 124 exit (STATE_UNKNOWN);
123 } 125 }
124 126
125 time (&local_time); 127 local_time = time (NULL);
126 commands = 0; 128 commands = 0;
127 while (result_text && strlen(result_text) > 0) { 129 while (result_text && strlen(result_text) > 0) {
128 status_text = strstr (result_text, _("STATUS CODE: ")); 130 status_text = strstr (result_text, "STATUS CODE: ");
129 if (status_text == NULL) { 131 if (status_text == NULL) {
130 printf ("%s", result_text); 132 printf ("%s", result_text);
131 return result; 133 return result;
@@ -136,7 +138,7 @@ main (int argc, char **argv)
136 if (eol != NULL) 138 if (eol != NULL)
137 eol[0] = 0; 139 eol[0] = 0;
138 if (service[commands] && status_text 140 if (service[commands] && status_text
139 && sscanf (status_text, _("STATUS CODE: %d"), &cresult) == 1) { 141 && sscanf (status_text, "STATUS CODE: %d", &cresult) == 1) {
140 fprintf (fp, _("[%d] PROCESS_SERVICE_CHECK_RESULT;%s;%s;%d;%s\n"), 142 fprintf (fp, _("[%d] PROCESS_SERVICE_CHECK_RESULT;%s;%s;%d;%s\n"),
141 (int) local_time, host_shortname, service[commands++], cresult, 143 (int) local_time, host_shortname, service[commands++], cresult,
142 output); 144 output);
@@ -145,6 +147,7 @@ main (int argc, char **argv)
145 147
146 } 148 }
147 149
150
148 /* print the first line from the remote command */ 151 /* print the first line from the remote command */
149 else { 152 else {
150 eol = strpbrk (result_text, "\r\n"); 153 eol = strpbrk (result_text, "\r\n");
@@ -153,7 +156,8 @@ main (int argc, char **argv)
153 printf ("%s\n", result_text); 156 printf ("%s\n", result_text);
154 } 157 }
155 158
156 /* return error status from remote command */ 159
160 /* return error status from remote command */
157 return result; 161 return result;
158} 162}
159 163
@@ -222,7 +226,8 @@ process_arguments (int argc, char **argv)
222 case 't': /* timeout period */ 226 case 't': /* timeout period */
223 if (!is_integer (optarg)) 227 if (!is_integer (optarg))
224 usage2 (_("timeout interval must be an integer"), optarg); 228 usage2 (_("timeout interval must be an integer"), optarg);
225 timeout_interval = atoi (optarg); 229 else
230 timeout_interval = atoi (optarg);
226 break; 231 break;
227 case 'H': /* host */ 232 case 'H': /* host */
228 if (!is_host (optarg)) 233 if (!is_host (optarg))
@@ -382,6 +387,8 @@ execute additional commands as proxy\n"));
382To use passive mode, provide multiple '-C' options, and provide\n\ 387To use passive mode, provide multiple '-C' options, and provide\n\
383all of -O, -s, and -n options (servicelist order must match '-C'\n\ 388all of -O, -s, and -n options (servicelist order must match '-C'\n\
384options)\n")); 389options)\n"));
390
391 printf (_(UT_SUPPORT));
385} 392}
386 393
387 394
diff --git a/plugins/check_dig.c b/plugins/check_dig.c
index f376e309..dc4f89ae 100644
--- a/plugins/check_dig.c
+++ b/plugins/check_dig.c
@@ -42,11 +42,6 @@ int server_port = DEFAULT_PORT;
42int warning_interval = -1; 42int warning_interval = -1;
43int critical_interval = -1; 43int critical_interval = -1;
44 44
45
46
47
48
49
50int 45int
51main (int argc, char **argv) 46main (int argc, char **argv)
52{ 47{
@@ -57,6 +52,10 @@ main (int argc, char **argv)
57 52
58 output = strdup (""); 53 output = strdup ("");
59 54
55 setlocale (LC_ALL, "");
56 bindtextdomain (PACKAGE, LOCALEDIR);
57 textdomain (PACKAGE);
58
60 /* Set signal handling and alarm */ 59 /* Set signal handling and alarm */
61 if (signal (SIGALRM, popen_timeout_alarm_handler) == SIG_ERR) 60 if (signal (SIGALRM, popen_timeout_alarm_handler) == SIG_ERR)
62 usage (_("Cannot catch SIGALRM\n")); 61 usage (_("Cannot catch SIGALRM\n"));
@@ -280,6 +279,7 @@ print_help (void)
280 279
281 print_revision (progname, revision); 280 print_revision (progname, revision);
282 281
282 printf (_("Copyright (c) 2000 Karl DeBisschop <kdebisschop@users.sourceforge.net>\n"));
283 printf (_(COPYRIGHT), copyright, email); 283 printf (_(COPYRIGHT), copyright, email);
284 284
285 printf (_("Test the DNS service on the specified host using dig\n\n")); 285 printf (_("Test the DNS service on the specified host using dig\n\n"));
diff --git a/plugins/check_disk.c b/plugins/check_disk.c
index c8cfecd2..36f30a59 100644
--- a/plugins/check_disk.c
+++ b/plugins/check_disk.c
@@ -151,6 +151,10 @@ main (int argc, char **argv)
151 output = strdup (""); 151 output = strdup ("");
152 details = strdup (""); 152 details = strdup ("");
153 153
154 setlocale (LC_ALL, "");
155 bindtextdomain (PACKAGE, LOCALEDIR);
156 textdomain (PACKAGE);
157
154 mount_list = read_filesystem_list (0); 158 mount_list = read_filesystem_list (0);
155 159
156 if (process_arguments (argc, argv) != OK) 160 if (process_arguments (argc, argv) != OK)
diff --git a/plugins/check_dns.c b/plugins/check_dns.c
index 58c0a1bf..328fc5f4 100644
--- a/plugins/check_dns.c
+++ b/plugins/check_dns.c
@@ -82,6 +82,10 @@ main (int argc, char **argv)
82 struct timeval tv; 82 struct timeval tv;
83 int multi_address; 83 int multi_address;
84 84
85 setlocale (LC_ALL, "");
86 bindtextdomain (PACKAGE, LOCALEDIR);
87 textdomain (PACKAGE);
88
85 /* Set signal handling and alarm */ 89 /* Set signal handling and alarm */
86 if (signal (SIGALRM, popen_timeout_alarm_handler) == SIG_ERR) { 90 if (signal (SIGALRM, popen_timeout_alarm_handler) == SIG_ERR) {
87 printf (_("Cannot catch SIGALRM")); 91 printf (_("Cannot catch SIGALRM"));
@@ -398,6 +402,7 @@ print_help (void)
398{ 402{
399 print_revision (progname, revision); 403 print_revision (progname, revision);
400 404
405 printf (_("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n"));
401 printf (_(COPYRIGHT), copyright, email); 406 printf (_(COPYRIGHT), copyright, email);
402 407
403 print_usage (); 408 print_usage ();
diff --git a/plugins/check_dummy.c b/plugins/check_dummy.c
index 3db5238f..9ca7a3ab 100644
--- a/plugins/check_dummy.c
+++ b/plugins/check_dummy.c
@@ -34,6 +34,10 @@ main (int argc, char **argv)
34{ 34{
35 int result; 35 int result;
36 36
37 setlocale (LC_ALL, "");
38 bindtextdomain (PACKAGE, LOCALEDIR);
39 textdomain (PACKAGE);
40
37 if (argc != 2) 41 if (argc != 2)
38 usage (_("Incorrect number of arguments supplied\n")); 42 usage (_("Incorrect number of arguments supplied\n"));
39 else if (strcmp (argv[1], "-V") == 0 || strcmp (argv[1], "--version") == 0) { 43 else if (strcmp (argv[1], "-V") == 0 || strcmp (argv[1], "--version") == 0) {
diff --git a/plugins/check_fping.c b/plugins/check_fping.c
index bb178305..0753cf3d 100644
--- a/plugins/check_fping.c
+++ b/plugins/check_fping.c
@@ -69,6 +69,10 @@ main (int argc, char **argv)
69 char *input_buffer = NULL; 69 char *input_buffer = NULL;
70 input_buffer = malloc (MAX_INPUT_BUFFER); 70 input_buffer = malloc (MAX_INPUT_BUFFER);
71 71
72 setlocale (LC_ALL, "");
73 bindtextdomain (PACKAGE, LOCALEDIR);
74 textdomain (PACKAGE);
75
72 if (process_arguments (argc, argv) == ERROR) 76 if (process_arguments (argc, argv) == ERROR)
73 usage (_("Could not parse arguments\n")); 77 usage (_("Could not parse arguments\n"));
74 78
diff --git a/plugins/check_game.c b/plugins/check_game.c
index d5de13db..dd167773 100644
--- a/plugins/check_game.c
+++ b/plugins/check_game.c
@@ -60,6 +60,10 @@ main (int argc, char **argv)
60 char *p, *ret[QSTAT_MAX_RETURN_ARGS]; 60 char *p, *ret[QSTAT_MAX_RETURN_ARGS];
61 int i; 61 int i;
62 62
63 setlocale (LC_ALL, "");
64 bindtextdomain (PACKAGE, LOCALEDIR);
65 textdomain (PACKAGE);
66
63 result = process_arguments (argc, argv); 67 result = process_arguments (argc, argv);
64 68
65 if (result != OK) { 69 if (result != OK) {
diff --git a/plugins/check_hpjd.c b/plugins/check_hpjd.c
index edde341e..72f6bd7e 100644
--- a/plugins/check_hpjd.c
+++ b/plugins/check_hpjd.c
@@ -79,6 +79,10 @@ main (int argc, char **argv)
79 79
80 errmsg = malloc(MAX_INPUT_BUFFER); 80 errmsg = malloc(MAX_INPUT_BUFFER);
81 81
82 setlocale (LC_ALL, "");
83 bindtextdomain (PACKAGE, LOCALEDIR);
84 textdomain (PACKAGE);
85
82 if (process_arguments (argc, argv) != OK) 86 if (process_arguments (argc, argv) != OK)
83 usage (_("Invalid command arguments supplied\n")); 87 usage (_("Invalid command arguments supplied\n"));
84 88
@@ -374,6 +378,7 @@ print_help (void)
374{ 378{
375 print_revision (progname, revision); 379 print_revision (progname, revision);
376 380
381 printf (_("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n"));
377 printf (_(COPYRIGHT), copyright, email); 382 printf (_(COPYRIGHT), copyright, email);
378 383
379 printf (_("\ 384 printf (_("\
diff --git a/plugins/check_http.c b/plugins/check_http.c
index 2908c007..3ec9e499 100644
--- a/plugins/check_http.c
+++ b/plugins/check_http.c
@@ -815,7 +815,7 @@ redir (char *pos, char *status_line)
815 else if (sscanf (pos, HD5, url) == 1) { 815 else if (sscanf (pos, HD5, url) == 1) {
816 /* relative url */ 816 /* relative url */
817 if ((url[0] != '/')) { 817 if ((url[0] != '/')) {
818 if (x = strrchr(url, '/')) 818 if ((x = strrchr(url, '/')))
819 *x = '\0'; 819 *x = '\0';
820 asprintf (&server_url, "%s/%s", server_url, url); 820 asprintf (&server_url, "%s/%s", server_url, url);
821 } 821 }
diff --git a/plugins/check_ide-smart.c b/plugins/check_ide-smart.c
index ecd8a4e1..e1f1e747 100644
--- a/plugins/check_ide-smart.c
+++ b/plugins/check_ide-smart.c
@@ -396,6 +396,10 @@ main (int argc, char *argv[])
396 {"version", no_argument, 0, 'V'}, {0, 0, 0, 0} 396 {"version", no_argument, 0, 'V'}, {0, 0, 0, 0}
397 }; 397 };
398 398
399 setlocale (LC_ALL, "");
400 bindtextdomain (PACKAGE, LOCALEDIR);
401 textdomain (PACKAGE);
402
399 while (1) { 403 while (1) {
400 404
401 o = getopt_long (argc, argv, "+d:iq10nhV", longopts, &longindex); 405 o = getopt_long (argc, argv, "+d:iq10nhV", longopts, &longindex);
diff --git a/plugins/check_ldap.c b/plugins/check_ldap.c
index d2c6ae22..adfa966a 100644
--- a/plugins/check_ldap.c
+++ b/plugins/check_ldap.c
@@ -64,6 +64,10 @@ main (int argc, char *argv[])
64 int t_diff; 64 int t_diff;
65 time_t time0, time1; 65 time_t time0, time1;
66 66
67 setlocale (LC_ALL, "");
68 bindtextdomain (PACKAGE, LOCALEDIR);
69 textdomain (PACKAGE);
70
67 if (process_arguments (argc, argv) == ERROR) 71 if (process_arguments (argc, argv) == ERROR)
68 usage (_("check_ldap: could not parse arguments\n")); 72 usage (_("check_ldap: could not parse arguments\n"));
69 73
diff --git a/plugins/check_load.c b/plugins/check_load.c
index c12cad37..58113817 100644
--- a/plugins/check_load.c
+++ b/plugins/check_load.c
@@ -71,6 +71,10 @@ main (int argc, char **argv)
71 71
72 float la1, la5, la15; 72 float la1, la5, la15;
73 73
74 setlocale (LC_ALL, "");
75 bindtextdomain (PACKAGE, LOCALEDIR);
76 textdomain (PACKAGE);
77
74 if (process_arguments (argc, argv) == ERROR) 78 if (process_arguments (argc, argv) == ERROR)
75 usage ("failed processing arguments\n"); 79 usage ("failed processing arguments\n");
76 80
diff --git a/plugins/check_mrtg.c b/plugins/check_mrtg.c
index 849e636f..5d429d7d 100644
--- a/plugins/check_mrtg.c
+++ b/plugins/check_mrtg.c
@@ -53,6 +53,10 @@ main (int argc, char **argv)
53 unsigned long maximum_value_rate = 0L; 53 unsigned long maximum_value_rate = 0L;
54 unsigned long value_rate = 0L; 54 unsigned long value_rate = 0L;
55 55
56 setlocale (LC_ALL, "");
57 bindtextdomain (PACKAGE, LOCALEDIR);
58 textdomain (PACKAGE);
59
56 if (process_arguments (argc, argv) != OK) 60 if (process_arguments (argc, argv) != OK)
57 usage (_("Invalid command arguments supplied\n")); 61 usage (_("Invalid command arguments supplied\n"));
58 62
diff --git a/plugins/check_mysql.c b/plugins/check_mysql.c
index a7afa52f..d62bfc87 100644
--- a/plugins/check_mysql.c
+++ b/plugins/check_mysql.c
@@ -43,6 +43,10 @@ main (int argc, char **argv)
43 MYSQL mysql; 43 MYSQL mysql;
44 char *result = NULL; 44 char *result = NULL;
45 45
46 setlocale (LC_ALL, "");
47 bindtextdomain (PACKAGE, LOCALEDIR);
48 textdomain (PACKAGE);
49
46 if (process_arguments (argc, argv) != OK) 50 if (process_arguments (argc, argv) != OK)
47 usage (_("Invalid command arguments supplied\n")); 51 usage (_("Invalid command arguments supplied\n"));
48 52
diff --git a/plugins/check_nagios.c b/plugins/check_nagios.c
index 5b21ba1d..27bb0103 100644
--- a/plugins/check_nagios.c
+++ b/plugins/check_nagios.c
@@ -56,6 +56,10 @@ main (int argc, char **argv)
56 char *procargs; 56 char *procargs;
57 int pos, cols; 57 int pos, cols;
58 58
59 setlocale (LC_ALL, "");
60 bindtextdomain (PACKAGE, LOCALEDIR);
61 textdomain (PACKAGE);
62
59 if (process_arguments (argc, argv) == ERROR) 63 if (process_arguments (argc, argv) == ERROR)
60 usage (_("Could not parse arguments\n")); 64 usage (_("Could not parse arguments\n"));
61 65
diff --git a/plugins/check_nt.c b/plugins/check_nt.c
index 3b2bd5e1..c0d6c4e5 100644
--- a/plugins/check_nt.c
+++ b/plugins/check_nt.c
@@ -96,6 +96,10 @@ int main(int argc, char **argv){
96 int uphours=0; 96 int uphours=0;
97 int upminutes=0; 97 int upminutes=0;
98 98
99 setlocale (LC_ALL, "");
100 bindtextdomain (PACKAGE, LOCALEDIR);
101 textdomain (PACKAGE);
102
99 if(process_arguments(argc,argv)==ERROR) 103 if(process_arguments(argc,argv)==ERROR)
100 usage(_("Could not parse arguments\n")); 104 usage(_("Could not parse arguments\n"));
101 105
diff --git a/plugins/check_nwstat.c b/plugins/check_nwstat.c
index 92a1f117..4ceb58fc 100644
--- a/plugins/check_nwstat.c
+++ b/plugins/check_nwstat.c
@@ -117,6 +117,10 @@ main(int argc, char **argv) {
117 unsigned long sap_entries=0; 117 unsigned long sap_entries=0;
118 char uptime[MAX_INPUT_BUFFER]; 118 char uptime[MAX_INPUT_BUFFER];
119 119
120 setlocale (LC_ALL, "");
121 bindtextdomain (PACKAGE, LOCALEDIR);
122 textdomain (PACKAGE);
123
120 if (process_arguments(argc,argv)==ERROR) 124 if (process_arguments(argc,argv)==ERROR)
121 usage(_("Could not parse arguments\n")); 125 usage(_("Could not parse arguments\n"));
122 126
diff --git a/plugins/check_overcr.c b/plugins/check_overcr.c
index 67fb5d1f..581db50f 100644
--- a/plugins/check_overcr.c
+++ b/plugins/check_overcr.c
@@ -79,6 +79,10 @@ main (int argc, char **argv)
79 int uptime_hours = 0; 79 int uptime_hours = 0;
80 int uptime_minutes = 0; 80 int uptime_minutes = 0;
81 81
82 setlocale (LC_ALL, "");
83 bindtextdomain (PACKAGE, LOCALEDIR);
84 textdomain (PACKAGE);
85
82 if (process_arguments (argc, argv) == ERROR) 86 if (process_arguments (argc, argv) == ERROR)
83 usage ("Could not parse arguments\n"); 87 usage ("Could not parse arguments\n");
84 88
diff --git a/plugins/check_pgsql.c b/plugins/check_pgsql.c
index 6cd217e0..16b9a96e 100644
--- a/plugins/check_pgsql.c
+++ b/plugins/check_pgsql.c
@@ -128,6 +128,10 @@ main (int argc, char **argv)
128 pgoptions = NULL; /* special options to start up the backend server */ 128 pgoptions = NULL; /* special options to start up the backend server */
129 pgtty = NULL; /* debugging tty for the backend server */ 129 pgtty = NULL; /* debugging tty for the backend server */
130 130
131 setlocale (LC_ALL, "");
132 bindtextdomain (PACKAGE, LOCALEDIR);
133 textdomain (PACKAGE);
134
131 if (process_arguments (argc, argv) == ERROR) 135 if (process_arguments (argc, argv) == ERROR)
132 usage ("Could not parse arguments"); 136 usage ("Could not parse arguments");
133 137
diff --git a/plugins/check_ping.c b/plugins/check_ping.c
index 7d9dd3bf..191fbedf 100644
--- a/plugins/check_ping.c
+++ b/plugins/check_ping.c
@@ -70,6 +70,10 @@ main (int argc, char **argv)
70 int this_result = STATE_UNKNOWN; 70 int this_result = STATE_UNKNOWN;
71 int i; 71 int i;
72 72
73 setlocale (LC_ALL, "");
74 bindtextdomain (PACKAGE, LOCALEDIR);
75 textdomain (PACKAGE);
76
73 addresses = malloc ((size_t)max_addr); 77 addresses = malloc ((size_t)max_addr);
74 78
75 if (process_arguments (argc, argv) == ERROR) 79 if (process_arguments (argc, argv) == ERROR)
diff --git a/plugins/check_procs.c b/plugins/check_procs.c
index 5313b977..8a3f7ac2 100644
--- a/plugins/check_procs.c
+++ b/plugins/check_procs.c
@@ -103,6 +103,10 @@ main (int argc, char **argv)
103 103
104 int result = STATE_UNKNOWN; 104 int result = STATE_UNKNOWN;
105 105
106 setlocale (LC_ALL, "");
107 bindtextdomain (PACKAGE, LOCALEDIR);
108 textdomain (PACKAGE);
109
106 asprintf (&metric_name, "PROCS"); 110 asprintf (&metric_name, "PROCS");
107 metric = METRIC_PROCS; 111 metric = METRIC_PROCS;
108 112
diff --git a/plugins/check_radius.c b/plugins/check_radius.c
index 1e4fff7a..d56222f9 100644
--- a/plugins/check_radius.c
+++ b/plugins/check_radius.c
@@ -103,6 +103,10 @@ main (int argc, char **argv)
103 UINT4 client_id; 103 UINT4 client_id;
104 char *str; 104 char *str;
105 105
106 setlocale (LC_ALL, "");
107 bindtextdomain (PACKAGE, LOCALEDIR);
108 textdomain (PACKAGE);
109
106 if (process_arguments (argc, argv) == ERROR) 110 if (process_arguments (argc, argv) == ERROR)
107 usage (_("Could not parse arguments\n")); 111 usage (_("Could not parse arguments\n"));
108 112
diff --git a/plugins/check_real.c b/plugins/check_real.c
index 3e8475a7..05e39d79 100644
--- a/plugins/check_real.c
+++ b/plugins/check_real.c
@@ -61,6 +61,10 @@ main (int argc, char **argv)
61 char buffer[MAX_INPUT_BUFFER]; 61 char buffer[MAX_INPUT_BUFFER];
62 char *status_line = NULL; 62 char *status_line = NULL;
63 63
64 setlocale (LC_ALL, "");
65 bindtextdomain (PACKAGE, LOCALEDIR);
66 textdomain (PACKAGE);
67
64 if (process_arguments (argc, argv) != OK) 68 if (process_arguments (argc, argv) != OK)
65 usage (_("Invalid command arguments supplied\n")); 69 usage (_("Invalid command arguments supplied\n"));
66 70
diff --git a/plugins/check_smtp.c b/plugins/check_smtp.c
index b35ebbc0..8440aab1 100644
--- a/plugins/check_smtp.c
+++ b/plugins/check_smtp.c
@@ -66,6 +66,10 @@ main (int argc, char **argv)
66 char *helocmd = NULL; 66 char *helocmd = NULL;
67 struct timeval tv; 67 struct timeval tv;
68 68
69 setlocale (LC_ALL, "");
70 bindtextdomain (PACKAGE, LOCALEDIR);
71 textdomain (PACKAGE);
72
69 if (process_arguments (argc, argv) != OK) 73 if (process_arguments (argc, argv) != OK)
70 usage (_("Invalid command arguments supplied\n")); 74 usage (_("Invalid command arguments supplied\n"));
71 75
diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c
index af8f1198..cb985cab 100644
--- a/plugins/check_snmp.c
+++ b/plugins/check_snmp.c
@@ -137,6 +137,10 @@ main (int argc, char **argv)
137 char *p2 = NULL; 137 char *p2 = NULL;
138 char *show = NULL; 138 char *show = NULL;
139 139
140 setlocale (LC_ALL, "");
141 bindtextdomain (PACKAGE, LOCALEDIR);
142 textdomain (PACKAGE);
143
140 labels = malloc (labels_size); 144 labels = malloc (labels_size);
141 unitv = malloc (unitv_size); 145 unitv = malloc (unitv_size);
142 for (i = 0; i < MAX_OIDS; i++) 146 for (i = 0; i < MAX_OIDS; i++)
@@ -443,7 +447,8 @@ process_arguments (int argc, char **argv)
443 case 't': /* timeout period */ 447 case 't': /* timeout period */
444 if (!is_integer (optarg)) 448 if (!is_integer (optarg))
445 usage2 (_("Timeout Interval must be an integer"), optarg); 449 usage2 (_("Timeout Interval must be an integer"), optarg);
446 timeout_interval = atoi (optarg); 450 else
451 timeout_interval = atoi (optarg);
447 break; 452 break;
448 453
449 /* Test parameters */ 454 /* Test parameters */
diff --git a/plugins/check_ssh.c b/plugins/check_ssh.c
index 26709a7d..79e17017 100644
--- a/plugins/check_ssh.c
+++ b/plugins/check_ssh.c
@@ -48,6 +48,10 @@ main (int argc, char **argv)
48{ 48{
49 int result; 49 int result;
50 50
51 setlocale (LC_ALL, "");
52 bindtextdomain (PACKAGE, LOCALEDIR);
53 textdomain (PACKAGE);
54
51 if (process_arguments (argc, argv) == ERROR) 55 if (process_arguments (argc, argv) == ERROR)
52 usage (_("Could not parse arguments\n")); 56 usage (_("Could not parse arguments\n"));
53 57
diff --git a/plugins/check_swap.c b/plugins/check_swap.c
index a4e7e814..3bbea77b 100644
--- a/plugins/check_swap.c
+++ b/plugins/check_swap.c
@@ -71,6 +71,10 @@ main (int argc, char **argv)
71 char str[32]; 71 char str[32];
72 char *status; 72 char *status;
73 73
74 setlocale (LC_ALL, "");
75 bindtextdomain (PACKAGE, LOCALEDIR);
76 textdomain (PACKAGE);
77
74 status = strdup(""); 78 status = strdup("");
75 79
76 if (process_arguments (argc, argv) != OK) 80 if (process_arguments (argc, argv) != OK)
@@ -205,8 +209,6 @@ int
205process_arguments (int argc, char **argv) 209process_arguments (int argc, char **argv)
206{ 210{
207 int c = 0; /* option character */ 211 int c = 0; /* option character */
208 int wc = 0; /* warning counter */
209 int cc = 0; /* critical counter */
210 212
211 int option = 0; 213 int option = 0;
212 static struct option longopts[] = { 214 static struct option longopts[] = {
@@ -229,7 +231,7 @@ process_arguments (int argc, char **argv)
229 break; 231 break;
230 232
231 switch (c) { 233 switch (c) {
232 case 'w': /* warning time threshold */ 234 case 'w': /* warning size threshold */
233 if (is_intnonneg (optarg)) { 235 if (is_intnonneg (optarg)) {
234 warn_size = atoi (optarg); 236 warn_size = atoi (optarg);
235 break; 237 break;
@@ -246,7 +248,7 @@ process_arguments (int argc, char **argv)
246 else { 248 else {
247 usage (_("Warning threshold must be integer or percentage!\n")); 249 usage (_("Warning threshold must be integer or percentage!\n"));
248 } 250 }
249 case 'c': /* critical time threshold */ 251 case 'c': /* critical size threshold */
250 if (is_intnonneg (optarg)) { 252 if (is_intnonneg (optarg)) {
251 crit_size = atoi (optarg); 253 crit_size = atoi (optarg);
252 break; 254 break;
diff --git a/plugins/check_tcp.c b/plugins/check_tcp.c
index bf8ed8ca..a660649c 100644
--- a/plugins/check_tcp.c
+++ b/plugins/check_tcp.c
@@ -16,8 +16,8 @@
16 16
17*****************************************************************************/ 17*****************************************************************************/
18 18
19/* progname changes depending on symlink called */ 19/* progname "check_tcp" changes depending on symlink called */
20char *progname = "check_tcp"; 20char *progname;
21const char *revision = "$Revision$"; 21const char *revision = "$Revision$";
22const char *copyright = "1999-2003"; 22const char *copyright = "1999-2003";
23const char *email = "nagiosplug-devel@lists.sourceforge.net"; 23const char *email = "nagiosplug-devel@lists.sourceforge.net";
@@ -198,6 +198,7 @@ main (int argc, char **argv)
198 PORT = 119; 198 PORT = 119;
199 } 199 }
200 else { 200 else {
201 progname = strdup ("check_tcp");
201 usage (_("ERROR: Generic check_tcp called with unknown service\n")); 202 usage (_("ERROR: Generic check_tcp called with unknown service\n"));
202 } 203 }
203 204
@@ -592,6 +593,7 @@ print_help (void)
592{ 593{
593 print_revision (progname, revision); 594 print_revision (progname, revision);
594 595
596 printf (_("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n"));
595 printf (_(COPYRIGHT), copyright, email); 597 printf (_(COPYRIGHT), copyright, email);
596 598
597 printf (_("This plugin tests %s connections with the specified host.\n\n"), 599 printf (_("This plugin tests %s connections with the specified host.\n\n"),
diff --git a/plugins/check_time.c b/plugins/check_time.c
index e6c3c716..f73005d5 100644
--- a/plugins/check_time.c
+++ b/plugins/check_time.c
@@ -55,6 +55,10 @@ main (int argc, char **argv)
55 int sd; 55 int sd;
56 int result; 56 int result;
57 57
58 setlocale (LC_ALL, "");
59 bindtextdomain (PACKAGE, LOCALEDIR);
60 textdomain (PACKAGE);
61
58 if (process_arguments (argc, argv) != OK) 62 if (process_arguments (argc, argv) != OK)
59 usage (_("Invalid command arguments supplied\n")); 63 usage (_("Invalid command arguments supplied\n"));
60 64
diff --git a/plugins/check_udp.c b/plugins/check_udp.c
index 5aaf3a79..c4fbbf85 100644
--- a/plugins/check_udp.c
+++ b/plugins/check_udp.c
@@ -45,6 +45,10 @@ main (int argc, char **argv)
45 int result; 45 int result;
46 char recv_buffer[MAX_INPUT_BUFFER]; 46 char recv_buffer[MAX_INPUT_BUFFER];
47 47
48 setlocale (LC_ALL, "");
49 bindtextdomain (PACKAGE, LOCALEDIR);
50 textdomain (PACKAGE);
51
48 if (process_arguments (argc, argv) == ERROR) 52 if (process_arguments (argc, argv) == ERROR)
49 usage ("\n"); 53 usage ("\n");
50 54
diff --git a/plugins/check_ups.c b/plugins/check_ups.c
index 7e7b36a4..391c1dbe 100644
--- a/plugins/check_ups.c
+++ b/plugins/check_ups.c
@@ -79,8 +79,12 @@ main (int argc, char **argv)
79 int result = STATE_OK; 79 int result = STATE_OK;
80 char *message; 80 char *message;
81 char temp_buffer[MAX_INPUT_BUFFER]; 81 char temp_buffer[MAX_INPUT_BUFFER];
82
83 double ups_utility_deviation = 0.0; 82 double ups_utility_deviation = 0.0;
83
84 setlocale (LC_ALL, "");
85 bindtextdomain (PACKAGE, LOCALEDIR);
86 textdomain (PACKAGE);
87
84 ups_status = strdup ("N/A"); 88 ups_status = strdup ("N/A");
85 89
86 if (process_arguments (argc, argv) != OK) 90 if (process_arguments (argc, argv) != OK)
diff --git a/plugins/check_users.c b/plugins/check_users.c
index 9f308bc3..3705ee10 100644
--- a/plugins/check_users.c
+++ b/plugins/check_users.c
@@ -41,6 +41,10 @@ main (int argc, char **argv)
41 int result = STATE_OK; 41 int result = STATE_OK;
42 char input_buffer[MAX_INPUT_BUFFER]; 42 char input_buffer[MAX_INPUT_BUFFER];
43 43
44 setlocale (LC_ALL, "");
45 bindtextdomain (PACKAGE, LOCALEDIR);
46 textdomain (PACKAGE);
47
44 if (process_arguments (argc, argv) == ERROR) 48 if (process_arguments (argc, argv) == ERROR)
45 usage (_("Could not parse arguments\n")); 49 usage (_("Could not parse arguments\n"));
46 50
diff --git a/plugins/negate.c b/plugins/negate.c
index c24658af..874aea14 100644
--- a/plugins/negate.c
+++ b/plugins/negate.c
@@ -75,6 +75,10 @@ main (int argc, char **argv)
75 int found = 0, result = STATE_UNKNOWN; 75 int found = 0, result = STATE_UNKNOWN;
76 char *buf; 76 char *buf;
77 77
78 setlocale (LC_ALL, "");
79 bindtextdomain (PACKAGE, LOCALEDIR);
80 textdomain (PACKAGE);
81
78 if (process_arguments (argc, argv) == ERROR) 82 if (process_arguments (argc, argv) == ERROR)
79 usage (_("Could not parse arguments\n")); 83 usage (_("Could not parse arguments\n"));
80 84
diff --git a/plugins/urlize.c b/plugins/urlize.c
index f4bc67b3..45766d0c 100644
--- a/plugins/urlize.c
+++ b/plugins/urlize.c
@@ -45,6 +45,10 @@ main (int argc, char **argv)
45 {0, 0, 0, 0} 45 {0, 0, 0, 0}
46 }; 46 };
47 47
48 setlocale (LC_ALL, "");
49 bindtextdomain (PACKAGE, LOCALEDIR);
50 textdomain (PACKAGE);
51
48 while (1) { 52 while (1) {
49 c = getopt_long (argc, argv, "+hVu:", longopts, &option); 53 c = getopt_long (argc, argv, "+hVu:", longopts, &option);
50 54