X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=plugins%2Fcheck_snmp.c;h=ef411e15fe59208e521b66fbdb7a723cbaff06a2;hb=3982b98ba2db3ebebf65d7f0f4ad83a55a3efc49;hp=c1c4ea831b7db57093296956fe12ebb9fbde1e94;hpb=e71d2c2b71d20ba3110030b4c6f3de1d9e827313;p=nagiosplug.git diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c index c1c4ea8..ef411e1 100644 --- a/plugins/check_snmp.c +++ b/plugins/check_snmp.c @@ -251,7 +251,7 @@ main (int argc, char **argv) eval_method[i] & WARN_NE) { p2 = strpbrk (p2, "0123456789"); if (p2 == NULL) - die (STATE_UNKNOWN,"No valid data returned"); + die (STATE_UNKNOWN,_("No valid data returned")); response_value[i] = strtoul (p2, NULL, 10); iresult = check_num (i); asprintf (&show, "%lu", response_value[i]); @@ -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 } @@ -398,9 +398,7 @@ process_arguments (int argc, char **argv) switch (c) { case '?': /* usage */ - printf (_("%s: Unknown argument: %s\n\n"), progname, optarg); - print_usage (); - exit (STATE_UNKNOWN); + usage2 (_("Unknown argument"), optarg); case 'h': /* help */ print_help (); exit (STATE_OK); @@ -513,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; @@ -532,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); @@ -545,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); @@ -562,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); @@ -648,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); } @@ -665,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; @@ -795,7 +789,7 @@ thisarg (char *str) str += strspn (str, " \t\r\n"); /* trim any leading whitespace */ if (strstr (str, "'") == str) { /* handle SIMPLE quoted strings */ if (strlen (str) == 1 || !strstr (str + 1, "'")) - die (STATE_UNKNOWN, "Unbalanced quotes\n"); + die (STATE_UNKNOWN, _("Unbalanced quotes\n")); } return str; }