diff options
Diffstat (limited to 'plugins/check_ldap.c')
-rw-r--r-- | plugins/check_ldap.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/plugins/check_ldap.c b/plugins/check_ldap.c index 582c9564..4f143280 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 | |||
331 | int | 330 | int |
332 | validate_arguments () | 331 | validate_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 | |||
346 | void | 343 | void |
347 | print_help (void) | 344 | print_help (void) |
348 | { | 345 | { |
@@ -392,7 +389,6 @@ print_help (void) | |||
392 | } | 389 | } |
393 | 390 | ||
394 | 391 | ||
395 | |||
396 | void | 392 | void |
397 | print_usage (void) | 393 | print_usage (void) |
398 | { | 394 | { |