From 7df9bd7bab72af4f300eef9dc509a226924de58b Mon Sep 17 00:00:00 2001 From: Benoit Mortier Date: Thu, 30 Dec 2004 00:41:41 +0000 Subject: more internationalization fixes internationalization freeze for beta1 git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1067 f882894a-f735-0410-b71e-b25c423dba1c --- plugins/check_dhcp.c | 11 +++-------- plugins/check_dns.c | 6 +++--- plugins/check_ping.c | 2 +- plugins/check_procs.c | 12 ++++++------ plugins/check_smtp.c | 12 ++++++------ plugins/check_snmp.c | 18 +++++++----------- plugins/check_swap.c | 10 +++++----- plugins/check_tcp.c | 2 +- 8 files changed, 32 insertions(+), 41 deletions(-) (limited to 'plugins') diff --git a/plugins/check_dhcp.c b/plugins/check_dhcp.c index 1a16d3e7..6703c57c 100644 --- a/plugins/check_dhcp.c +++ b/plugins/check_dhcp.c @@ -927,7 +927,7 @@ int get_results(void){ printf(_(", %s%d of %d requested servers responded"),((requested_responses0)?"only ":"",requested_responses,requested_servers); if(request_specific_address==TRUE) - printf(_(", requested address (%s) was %soffered"),inet_ntoa(requested_address),(received_requested_address==TRUE)?"":"not "); + printf(_(", requested address (%s) was %soffered"),inet_ntoa(requested_address),(received_requested_address==TRUE)?"":_("not ")); printf(_(", max lease time = ")); if(max_lease_time==DHCP_INFINITE_TIME) @@ -1048,23 +1048,19 @@ int call_getopt(int argc, char **argv){ break; case 'V': /* version */ - - /*print_revision(progname,"$Revision$");*/ + print_revision(progname,revision); exit(STATE_OK); case 'h': /* help */ - print_help(); exit(STATE_OK); case 'v': /* verbose */ - verbose=1; break; case '?': /* help */ - - /*usage("Invalid argument\n");*/ + usage2 (_("Unknown argument"), optarg); break; default: @@ -1076,7 +1072,6 @@ int call_getopt(int argc, char **argv){ } - int validate_arguments(void){ return OK; diff --git a/plugins/check_dns.c b/plugins/check_dns.c index e6483b9c..94d4300c 100644 --- a/plugins/check_dns.c +++ b/plugins/check_dns.c @@ -224,9 +224,9 @@ error_scan (char *input_buffer) { /* the DNS lookup timed out */ - if (strstr (input_buffer, "Note: nslookup is deprecated and may be removed from future releases.") || - strstr (input_buffer, "Consider using the `dig' or `host' programs instead. Run nslookup with") || - strstr (input_buffer, "the `-sil[ent]' option to prevent this message from appearing.")) + if (strstr (input_buffer, _("Note: nslookup is deprecated and may be removed from future releases.")) || + strstr (input_buffer, _("Consider using the `dig' or `host' programs instead. Run nslookup with")) || + strstr (input_buffer, _("the `-sil[ent]' option to prevent this message from appearing."))) return STATE_OK; /* DNS server is not running... */ diff --git a/plugins/check_ping.c b/plugins/check_ping.c index 2198e32b..bd7911d7 100644 --- a/plugins/check_ping.c +++ b/plugins/check_ping.c @@ -403,7 +403,7 @@ run_ping (const char *cmd, const char *addr) int result = STATE_UNKNOWN; if ((child_process = spopen (cmd)) == NULL) - die (STATE_UNKNOWN, _("Cannot open pipe: %s"), cmd); + die (STATE_UNKNOWN, _("Could not open pipe: %s\n"), cmd); child_stderr = fdopen (child_stderr_array[fileno (child_process)], "r"); if (child_stderr == NULL) diff --git a/plugins/check_procs.c b/plugins/check_procs.c index 0cd9153c..15ec76f5 100644 --- a/plugins/check_procs.c +++ b/plugins/check_procs.c @@ -249,7 +249,7 @@ main (int argc, char **argv) /* If we get anything on STDERR, at least set warning */ while (fgets (input_buffer, MAX_INPUT_BUFFER - 1, child_stderr)) { if (verbose) - printf (_("STDERR: %s"), input_buffer); + printf ("STDERR: %s", input_buffer); result = max_state (result, STATE_WARNING); printf (_("System call sent warnings to stderr\n")); } @@ -412,7 +412,7 @@ process_arguments (int argc, char **argv) uid = pw->pw_uid; } user = pw->pw_name; - asprintf (&fmt, _("%s%sUID = %d (%s)"), (fmt ? fmt : ""), (options ? ", " : ""), + asprintf (&fmt, "%s%sUID = %d (%s)", (fmt ? fmt : ""), (options ? ", " : ""), uid, user); options |= USER; break; @@ -432,19 +432,19 @@ process_arguments (int argc, char **argv) break; else args = optarg; - asprintf (&fmt, _("%s%sargs '%s'"), (fmt ? fmt : ""), (options ? ", " : ""), args); + asprintf (&fmt, "%s%sargs '%s'", (fmt ? fmt : ""), (options ? ", " : ""), args); options |= ARGS; break; case 'r': /* RSS */ if (sscanf (optarg, "%d%[^0-9]", &rss, tmp) == 1) { - asprintf (&fmt, _("%s%sRSS >= %d"), (fmt ? fmt : ""), (options ? ", " : ""), rss); + asprintf (&fmt, "%s%sRSS >= %d", (fmt ? fmt : ""), (options ? ", " : ""), rss); options |= RSS; break; } usage4 (_("RSS must be an integer!")); case 'z': /* VSZ */ if (sscanf (optarg, "%d%[^0-9]", &vsz, tmp) == 1) { - asprintf (&fmt, _("%s%sVSZ >= %d"), (fmt ? fmt : ""), (options ? ", " : ""), vsz); + asprintf (&fmt, "%s%sVSZ >= %d", (fmt ? fmt : ""), (options ? ", " : ""), vsz); options |= VSZ; break; } @@ -452,7 +452,7 @@ process_arguments (int argc, char **argv) case 'P': /* PCPU */ /* TODO: -P 1.5.5 is accepted */ if (sscanf (optarg, "%f%[^0-9.]", &pcpu, tmp) == 1) { - asprintf (&fmt, _("%s%sPCPU >= %.2f"), (fmt ? fmt : ""), (options ? ", " : ""), pcpu); + asprintf (&fmt, "%s%sPCPU >= %.2f", (fmt ? fmt : ""), (options ? ", " : ""), pcpu); options |= PCPU; break; } diff --git a/plugins/check_smtp.c b/plugins/check_smtp.c index 6e5d972a..f4a11e01 100644 --- a/plugins/check_smtp.c +++ b/plugins/check_smtp.c @@ -188,7 +188,7 @@ main (int argc, char **argv) return STATE_UNKNOWN; } if(connect_STARTTLS() != OK) { - printf (_("ERROR: Cannot create SSL context.\n")); + printf (_("CRITICAL - Cannot create SSL context.\n")); return STATE_CRITICAL; } if ( check_cert ) { @@ -197,7 +197,7 @@ main (int argc, char **argv) X509_free(server_cert); } else { - printf (_("ERROR: Cannot retrieve server certificate.\n")); + printf (_("CRITICAL - Cannot retrieve server certificate.\n")); result = STATE_CRITICAL; } @@ -591,7 +591,7 @@ connect_STARTTLS (void) SSL_load_error_strings (); if ((ctx = SSL_CTX_new (meth)) == NULL) { - printf(_("ERROR: Cannot create SSL context.\n")); + printf(_("CRITICAL - Cannot create SSL context.\n")); return STATE_CRITICAL; } /* do the SSL handshake */ @@ -606,7 +606,7 @@ connect_STARTTLS (void) } else { - printf (_("ERROR: Cannot initiate SSL handshake.\n")); + printf (_("CRITICAL - Cannot initiate SSL handshake.\n")); } /* this causes a seg faul not sure why, being sloppy @@ -632,7 +632,7 @@ check_certificate (X509 ** certificate) /* Generate tm structure to process timestamp */ if (tm->type == V_ASN1_UTCTIME) { if (tm->length < 10) { - printf (_("ERROR: Wrong time format in certificate.\n")); + printf (_("CRITICAL - Wrong time format in certificate.\n")); return STATE_CRITICAL; } else { @@ -644,7 +644,7 @@ check_certificate (X509 ** certificate) } else { if (tm->length < 12) { - printf (_("ERROR: Wrong time format in certificate.\n")); + printf (_("CRITICAL - Wrong time format in certificate.\n")); return STATE_CRITICAL; } else { diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c index 5f221218..ef411e15 100644 --- a/plugins/check_snmp.c +++ b/plugins/check_snmp.c @@ -281,7 +281,7 @@ main (int argc, char **argv) iresult = STATE_CRITICAL; } #else - printf (_("%s UNKNOWN: call for regex which was not a compiled option"), label); + printf (_("Call for regex which was not a compiled option")); exit (STATE_UNKNOWN); #endif } @@ -511,7 +511,7 @@ process_arguments (int argc, char **argv) eval_method[jj++] = CRIT_REGEX; ii++; #else - printf (_("%s UNKNOWN: call for regex which was not a compiled option"), label); + printf (_("call for regex which was not a compiled option")); exit (STATE_UNKNOWN); #endif break; @@ -530,8 +530,7 @@ process_arguments (int argc, char **argv) labels_size += 8; labels = realloc (labels, labels_size); if (labels == NULL) - die (STATE_UNKNOWN, - _("Could not realloc() labels[%d]"), nlabels); + die (STATE_UNKNOWN, _("Could not reallocate labels[%d]"), nlabels); } labels[nlabels - 1] = optarg; ptr = thisarg (optarg); @@ -543,7 +542,7 @@ process_arguments (int argc, char **argv) labels_size += 8; labels = realloc (labels, labels_size); if (labels == NULL) - die (STATE_UNKNOWN, _("Could not realloc() labels\n")); + die (STATE_UNKNOWN, _("Could not reallocate labels\n")); } labels++; ptr = thisarg (ptr); @@ -560,8 +559,7 @@ process_arguments (int argc, char **argv) unitv_size += 8; unitv = realloc (unitv, unitv_size); if (unitv == NULL) - die (STATE_UNKNOWN, - _("Could not realloc() units [%d]\n"), nunits); + die (STATE_UNKNOWN, _("Could not reallocate units [%d]\n"), nunits); } unitv[nunits - 1] = optarg; ptr = thisarg (optarg); @@ -646,7 +644,7 @@ validate_arguments () } else if ( strcmp(seclevel, "authNoPriv") == 0 ) { if ( secname == NULL || authpasswd == NULL) { - printf (_("Missing secname (%s) or authpassword (%s) ! \n)"),secname, authpasswd ); + printf (_("Missing secname (%s) or authpassword (%s) ! \n"),secname, authpasswd ); print_usage (); exit (STATE_UNKNOWN); } @@ -663,9 +661,7 @@ validate_arguments () } else { - printf (_("Invalid SNMP version: %s\n"), proto); - print_usage (); - exit (STATE_UNKNOWN); + usage2 (_("Invalid SNMP version"), proto); } return OK; diff --git a/plugins/check_swap.c b/plugins/check_swap.c index 093845b4..bcc6b170 100644 --- a/plugins/check_swap.c +++ b/plugins/check_swap.c @@ -405,7 +405,7 @@ process_arguments (int argc, char **argv) break; } else { - usage (_("Critical threshold must be integer or percentage!\n")); + usage4 (_("Critical threshold must be integer or percentage!")); } case 'a': /* all swap */ allswaps = TRUE; @@ -458,12 +458,12 @@ validate_arguments (void) return ERROR; } else if (warn_percent < crit_percent) { - usage - (_("Warning percentage should be more than critical percentage\n")); + usage4 + (_("Warning percentage should be more than critical percentage")); } else if (warn_size < crit_size) { - usage - (_("Warning free space should be more than critical free space\n")); + usage4 + (_("Warning free space should be more than critical free space")); } return OK; } diff --git a/plugins/check_tcp.c b/plugins/check_tcp.c index fcd67786..a21572d1 100644 --- a/plugins/check_tcp.c +++ b/plugins/check_tcp.c @@ -581,7 +581,7 @@ process_arguments (int argc, char **argv) case 'S': use_ssl = TRUE; #else - die (STATE_UNKNOWN, _("SSL support not available. Install OpenSSL and recompile.")); + die (STATE_UNKNOWN, _("Invalid option - SSL is not available")); #endif break; } -- cgit v1.2.3-74-g34f1