Making messages more consistent

git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@930 f882894a-f735-0410-b71e-b25c423dba1c
This commit is contained in:
Ton Voon 2004-11-24 00:46:40 +00:00
parent 589d466491
commit 0c1c9f51e2
31 changed files with 88 additions and 95 deletions

View file

@ -297,7 +297,7 @@ process_arguments (int argc, char **argv)
if (c <= argc) {
die (STATE_UNKNOWN, _("%s: You must provide a host name\n"), progname);
} else if (!is_host (argv[c]))
die (STATE_UNKNOWN, _("%s: Invalid host name %s\n"), progname, argv[c]);
die (STATE_UNKNOWN, "%s: %s %s\n", progname, _("Invalid host name"), argv[c]);
hostname = argv[c++];
}

View file

@ -321,8 +321,8 @@ print_help (void)
print_revision (progname, revision);
printf (_("Copyright (c) 2000 Karl DeBisschop <kdebisschop@users.sourceforge.net>\n"));
printf (_(COPYRIGHT), copyright, email);
printf ("Copyright (c) 2000 Karl DeBisschop <kdebisschop@users.sourceforge.net>\n");
printf (COPYRIGHT, copyright, email);
printf (_("Test the DNS service on the specified host using dig\n\n"));

View file

@ -304,7 +304,7 @@ process_arguments (int argc, char **argv)
break;
}
else {
usage (_("Timeout Interval must be an integer!\n"));
usage2 (_("Timeout interval must be a positive integer"), optarg);
}
case 'w': /* warning threshold */
if (is_intnonneg (optarg)) {
@ -572,8 +572,8 @@ print_help (void)
{
print_revision (progname, revision);
printf (_("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n"));
printf (_(COPYRIGHT), copyright, email);
printf ("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n");
printf (COPYRIGHT, copyright, email);
printf (_("\
This plugin checks the amount of used disk space on a mounted file system\n\

View file

@ -331,9 +331,7 @@ process_arguments (int argc, char **argv)
case 'r': /* reverse server name */
/* TODO: Is this is_host necessary? */
if (is_host (optarg) == FALSE) {
printf (_("Invalid host name/address\n\n"));
print_usage ();
exit (STATE_UNKNOWN);
usage2 (_("Invalid host name/address"), optarg);
}
if (strlen (optarg) >= ADDRESS_LENGTH)
die (STATE_UNKNOWN, _("Input buffer overflow\n"));
@ -391,8 +389,8 @@ print_help (void)
{
print_revision (progname, revision);
printf (_("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n"));
printf (_(COPYRIGHT), copyright, email);
printf ("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n");
printf (COPYRIGHT, copyright, email);
print_usage ();

View file

@ -86,8 +86,8 @@ print_help (void)
{
print_revision (progname, revision);
printf (_("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n"));
printf (_(COPYRIGHT), copyright, email);
printf ("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n");
printf (COPYRIGHT, copyright, email);
print_usage ();

View file

@ -80,7 +80,7 @@ main (int argc, char **argv)
/* run the command */
child_process = spopen (command_line);
if (child_process == NULL) {
printf (_("Unable to open pipe: %s\n"), command_line);
printf (_("Could not open pipe: %s\n"), command_line);
return STATE_UNKNOWN;
}
@ -254,9 +254,7 @@ process_arguments (int argc, char **argv)
break;
case 'H': /* hostname */
if (is_host (optarg) == FALSE) {
printf (_("Invalid host name/address\n\n"));
print_usage ();
exit (STATE_UNKNOWN);
usage2 (_("Invalid host name/address"), optarg);
}
server_name = strscpy (server_name, optarg);
break;
@ -362,8 +360,8 @@ print_help (void)
print_revision (progname, "$Revision$");
printf (_("Copyright (c) 1999 Didi Rieder <adrieder@sbox.tu-graz.ac.at>\n"));
printf (_(COPYRIGHT), copyright, email);
printf ("Copyright (c) 1999 Didi Rieder <adrieder@sbox.tu-graz.ac.at>\n");
printf (COPYRIGHT, copyright, email);
printf (_("\
This plugin will use the /bin/fping command (from saint) to ping the\n\

View file

@ -70,7 +70,7 @@ main (int argc, char **argv)
printf (_("Incorrect arguments supplied\n"));
printf ("\n");
print_revision (progname, revision);
printf (_("Copyright (c) 1999 Ian Cass, Knowledge Matters Limited\n"));
printf ("Copyright (c) 1999 Ian Cass, Knowledge Matters Limited\n");
printf (_("License: GPL\n"));
printf ("\n");
return STATE_UNKNOWN;
@ -91,7 +91,7 @@ main (int argc, char **argv)
/* run the command */
fp = spopen (command_line);
if (fp == NULL) {
printf (_("Error - Could not open pipe: %s\n"), command_line);
printf (_("Could not open pipe: %s\n"), command_line);
return STATE_UNKNOWN;
}

View file

@ -321,7 +321,7 @@ process_arguments (int argc, char **argv)
address = strscpy(address, optarg) ;
}
else {
usage (_("Invalid host name\n"));
usage2 (_("Invalid host name"), optarg);
}
break;
case 'C': /* community */
@ -344,7 +344,7 @@ process_arguments (int argc, char **argv)
address = argv[c++];
}
else {
usage (_("Invalid host name"));
usage2 (_("Invalid host name"), argv[c]);
}
}
@ -378,8 +378,8 @@ print_help (void)
{
print_revision (progname, revision);
printf (_("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n"));
printf (_(COPYRIGHT), copyright, email);
printf ("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n");
printf (COPYRIGHT, copyright, email);
printf (_("\
This plugin tests the STATUS of an HP printer with a JetDirect card.\n\

View file

@ -261,7 +261,7 @@ process_arguments (int argc, char **argv)
break;
case 't': /* timeout period */
if (!is_intnonneg (optarg))
usage2 (_("timeout interval must be a non-negative integer"), optarg);
usage2 (_("Timeout interval must be a positive integer"), optarg);
else
socket_timeout = atoi (optarg);
break;
@ -1363,8 +1363,8 @@ print_help (void)
{
print_revision (progname, revision);
printf (_("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n"));
printf (_(COPYRIGHT), copyright, email);
printf ("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n");
printf (COPYRIGHT, copyright, email);
printf (_("\
This plugin tests the HTTP service on the specified host. It can test\n\

View file

@ -195,7 +195,7 @@ process_arguments (int argc, char **argv)
exit (STATE_OK);
case 't': /* timeout period */
if (!is_intnonneg (optarg))
usage2 (_("timeout interval must be a positive integer"), optarg);
usage2 (_("Timeout interval must be a positive integer"), optarg);
else
socket_timeout = atoi (optarg);
break;
@ -283,8 +283,8 @@ print_help (void)
print_revision (progname, revision);
printf (_("Copyright (c) 1999 Didi Rieder (adrieder@sbox.tu-graz.ac.at)\n"));
printf (_(COPYRIGHT), copyright, email);
printf ("Copyright (c) 1999 Didi Rieder (adrieder@sbox.tu-graz.ac.at)\n");
printf (COPYRIGHT, copyright, email);
print_usage ();

View file

@ -303,8 +303,8 @@ print_help (void)
{
print_revision (progname, revision);
printf (_("Copyright (c) 1999 Felipe Gustavo de Almeida <galmeida@linux.ime.usp.br>\n"));
printf (_(COPYRIGHT), copyright, email);
printf ("Copyright (c) 1999 Felipe Gustavo de Almeida <galmeida@linux.ime.usp.br>\n");
printf (COPYRIGHT, copyright, email);
printf (_("This plugin tests the current system load average.\n\n"));

View file

@ -308,8 +308,8 @@ print_help (void)
{
print_revision (progname, revision);
printf (_("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n"));
printf (_(COPYRIGHT), copyright, email);
printf ("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n");
printf (COPYRIGHT, copyright, email);
printf(_("\
This plugin will check either the average or maximum value of one of the\n\

View file

@ -320,8 +320,8 @@ print_help (void)
{
print_revision (progname, revision);
printf (_("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n"));
printf (_(COPYRIGHT), copyright, email);
printf ("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n");
printf (COPYRIGHT, copyright, email);
print_usage ();

View file

@ -183,7 +183,7 @@ process_arguments (int argc, char **argv)
db_host = optarg;
}
else {
usage (_("Invalid host name\n"));
usage2 (_("Invalid host name"), optarg);
}
break;
case 'd': /* hostname */
@ -221,7 +221,7 @@ process_arguments (int argc, char **argv)
db_host = argv[c++];
}
else {
usage ("Invalid host name");
usage2 (_("Invalid host name"), optarg);
}
else if (strlen(db_user) == 0)
db_user = argv[c++];

View file

@ -906,8 +906,8 @@ void print_help(void)
print_revision (progname, revision);
printf (_("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n"));
printf (_(COPYRIGHT), copyright, email);
printf ("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n");
printf (COPYRIGHT, copyright, email);
printf (_("\
Usage: %s This plugin attempts to contact the MRTGEXT NLM running\n\

View file

@ -420,8 +420,8 @@ print_help (void)
print_revision (progname, revision);
printf (_("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n"));
printf (_(COPYRIGHT), copyright, email);
printf ("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n");
printf (COPYRIGHT, copyright, email);
printf (_("\
This plugin attempts to contact the Over-CR collector daemon running on the\n\

View file

@ -216,7 +216,7 @@ process_arguments (int argc, char **argv)
exit (STATE_OK);
case 't': /* timeout period */
if (!is_integer (optarg))
usage2 (_("Timeout Interval must be an integer"), optarg);
usage2 (_("Timeout interval must be a positive integer"), optarg);
else
timeout_interval = atoi (optarg);
break;
@ -234,7 +234,7 @@ process_arguments (int argc, char **argv)
break;
case 'H': /* host */
if (!is_host (optarg))
usage2 (_("You gave an invalid host name"), optarg);
usage2 (_("Invalid host name"), optarg);
else
pghost = optarg;
break;

View file

@ -270,8 +270,7 @@ process_arguments (int argc, char **argv)
if (addresses[0] == NULL) {
if (is_host (argv[c]) == FALSE) {
printf (_("Invalid host name/address: %s\n\n"), argv[c]);
return ERROR;
usage2 (_("Invalid host name/address"), argv[c]);
} else {
addresses[0] = argv[c++];
n_addresses++;
@ -506,8 +505,8 @@ print_help (void)
{
print_revision (progname, revision);
printf (_("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>"));
printf (_(COPYRIGHT), copyright, email);
printf ("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>");
printf (COPYRIGHT, copyright, email);
printf (_("Use ping to check connection statistics for a remote host.\n\n"));

View file

@ -348,7 +348,7 @@ process_arguments (int argc, char **argv)
exit (STATE_OK);
case 't': /* timeout period */
if (!is_integer (optarg))
usage (_("Timeout Interval must be an integer!\n\n"));
usage2 (_("Timeout interval must be a positive integer"), optarg);
else
timeout_interval = atoi (optarg);
break;
@ -588,8 +588,8 @@ print_help (void)
{
print_revision (progname, revision);
printf (_("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>"));
printf (_(COPYRIGHT), copyright, email);
printf ("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>");
printf (COPYRIGHT, copyright, email);
printf(_("\
Checks all processes and generates WARNING or CRITICAL states if the specified\n\

View file

@ -190,7 +190,7 @@ process_arguments (int argc, char **argv)
if (is_intpos (argv[4]))
timeout_interval = atoi (argv[4]);
else
usage (_("Timeout interval must be a positive integer"));
usage2 (_("Timeout interval must be a positive integer"), optarg);
if (is_intpos (argv[5]))
retries = atoi (argv[5]);
else
@ -227,9 +227,7 @@ process_arguments (int argc, char **argv)
break;
case 'H': /* hostname */
if (is_host (optarg) == FALSE) {
printf (_("Invalid host name/address\n\n"));
print_usage ();
exit (STATE_UNKNOWN);
usage2 (_("Invalid host name/address"), optarg);
}
server = optarg;
break;
@ -264,7 +262,7 @@ process_arguments (int argc, char **argv)
if (is_intpos (optarg))
timeout_interval = atoi (optarg);
else
usage (_("Timeout interval must be a positive integer"));
usage2 (_("Timeout interval must be a positive integer"), optarg);
break;
}
}
@ -284,8 +282,8 @@ print_help (void)
print_revision (progname, revision);
printf (_("Copyright (c) 1999 Robert August Vincent II\n"));
printf (_(COPYRIGHT), copyright, email);
printf ("Copyright (c) 1999 Robert August Vincent II\n");
printf (COPYRIGHT, copyright, email);
printf(_("Tests to see if a radius server is accepting connections.\n\n"));

View file

@ -303,7 +303,7 @@ process_arguments (int argc, char **argv)
else if (is_host (optarg))
server_address = optarg;
else
usage (_("Invalid host name\n"));
usage2 (_("Invalid host name"), optarg);
break;
case 'e': /* string to expect in response header */
server_expect = optarg;
@ -365,7 +365,7 @@ process_arguments (int argc, char **argv)
server_address = argv[c++];
}
else {
usage (_("Invalid host name"));
usage2 (_("Invalid host name"), argv[c]);
}
}
@ -403,8 +403,8 @@ print_help (void)
print_revision (progname, "$Revision$");
printf (_("Copyright (c) 1999 Pedro Leite <leite@cic.ua.pt>\n"));
printf (_(COPYRIGHT), copyright, email);
printf ("Copyright (c) 1999 Pedro Leite <leite@cic.ua.pt>\n");
printf (COPYRIGHT, copyright, email);
printf (_("This plugin tests the REAL service on the specified host.\n\n"));

View file

@ -292,7 +292,7 @@ process_arguments (int argc, char **argv)
server_address = optarg;
}
else {
usage (_("Invalid host name\n"));
usage2 (_("Invalid host name"), optarg);
}
break;
case 'p': /* port */
@ -384,7 +384,7 @@ process_arguments (int argc, char **argv)
if (is_host (argv[c]))
server_address = argv[c];
else
usage (_("Invalid host name"));
usage2 (_("Invalid host name"), argv[c]);
}
else {
asprintf (&server_address, "127.0.0.1");
@ -426,8 +426,8 @@ print_help (void)
print_revision (progname, revision);
printf (_("Copyright (c) 1999-2001 Ethan Galstad <nagios@nagios.org>\n"));
printf (_(COPYRIGHT), copyright, email);
printf ("Copyright (c) 1999-2001 Ethan Galstad <nagios@nagios.org>\n");
printf (COPYRIGHT, copyright, email);
printf(_("\
This plugin will attempt to open an SMTP connection with the host.\n\n"));

View file

@ -446,7 +446,7 @@ process_arguments (int argc, char **argv)
break;
case 't': /* timeout period */
if (!is_integer (optarg))
usage2 (_("Timeout Interval must be an integer"), optarg);
usage2 (_("Timeout interval must be a positive integer"), optarg);
else
timeout_interval = atoi (optarg);
break;

View file

@ -114,7 +114,7 @@ process_arguments (int argc, char **argv)
break;
case 't': /* timeout period */
if (!is_integer (optarg))
usage (_("Timeout Interval must be an integer!\n\n"));
usage2 (_("Timeout interval must be a positive integer"), optarg);
else
socket_timeout = atoi (optarg);
break;
@ -130,7 +130,7 @@ process_arguments (int argc, char **argv)
break;
case 'H': /* host */
if (is_host (optarg) == FALSE)
usage ("Invalid hostname/address\n");
usage2 (_("Invalid host name/address"), optarg);
server_name = optarg;
break;
case 'p': /* port */
@ -233,8 +233,8 @@ print_help (void)
print_revision (progname, revision);
printf (_("Copyright (c) 1999 Remi Paulmier <remi@sinfomic.fr>\n"));
printf (_(COPYRIGHT), copyright, email);
printf ("Copyright (c) 1999 Remi Paulmier <remi@sinfomic.fr>\n");
printf (COPYRIGHT, copyright, email);
printf (_("Try to connect to SSH server at specified server and port\n\n"));

View file

@ -429,7 +429,7 @@ process_arguments (int argc, char **argv)
break;
case 'H': /* hostname */
if (is_host (optarg) == FALSE)
usage2 (_("invalid host name or address"), optarg);
usage2 (_("Invalid host name/address"), optarg);
server_address = optarg;
break;
case 'c': /* critical */
@ -459,7 +459,7 @@ process_arguments (int argc, char **argv)
break;
case 't': /* timeout */
if (!is_intpos (optarg))
usage (_("Timeout interval must be a positive integer\n"));
usage2 (_("Timeout interval must be a positive integer"), optarg);
else
socket_timeout = atoi (optarg);
break;
@ -603,8 +603,8 @@ print_help (void)
{
print_revision (progname, revision);
printf (_("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n"));
printf (_(COPYRIGHT), copyright, email);
printf ("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n");
printf (COPYRIGHT, copyright, email);
printf (_("This plugin tests %s connections with the specified host.\n\n"),
SERVICE);

View file

@ -226,7 +226,7 @@ process_arguments (int argc, char **argv)
exit (STATE_OK);
case 'H': /* hostname */
if (is_host (optarg) == FALSE)
usage (_("Invalid host name/address\n"));
usage2 (_("Invalid host name/address"), optarg);
server_address = optarg;
break;
case 'w': /* warning-variance */
@ -288,7 +288,7 @@ process_arguments (int argc, char **argv)
break;
case 't': /* timeout */
if (!is_intnonneg (optarg))
usage (_("Timeout interval must be a nonnegative integer\n"));
usage2 (_("Timeout interval must be a positive integer"), optarg);
else
socket_timeout = atoi (optarg);
break;
@ -301,7 +301,7 @@ process_arguments (int argc, char **argv)
if (server_address == NULL) {
if (argc > c) {
if (is_host (argv[c]) == FALSE)
usage (_("Invalid host name/address\n"));
usage2 (_("Invalid host name/address"), optarg);
server_address = argv[c];
}
else {
@ -325,8 +325,8 @@ print_help (void)
print_revision (progname, revision);
printf (_("Copyright (c) 1999 Ethan Galstad\n"));
printf (_(COPYRIGHT), copyright, email);
printf ("Copyright (c) 1999 Ethan Galstad\n");
printf (COPYRIGHT, copyright, email);
printf (_("\
This plugin will check the time on the specified host.\n\n"));

View file

@ -158,7 +158,7 @@ process_arguments (int argc, char **argv)
break;
case 'H': /* hostname */
if (is_host (optarg) == FALSE)
usage (_("Invalid host name/address\n"));
usage2 (_("Invalid host name/address"), optarg);
server_address = optarg;
break;
case 'c': /* critical */
@ -177,7 +177,7 @@ process_arguments (int argc, char **argv)
break;
case 't': /* timeout */
if (!is_intnonneg (optarg))
usage (_("Timeout interval must be a nonnegative integer\n"));
usage2 (_("Timeout interval must be a positive integer"), optarg);
else
socket_timeout = atoi (optarg);
break;
@ -199,7 +199,7 @@ process_arguments (int argc, char **argv)
c = optind;
if (server_address == NULL && c < argc && argv[c]) {
if (is_host (argv[c]) == FALSE)
usage (_("Invalid host name/address\n"));
usage2 (_("Invalid host name/address"), optarg);
server_address = argv[c++];
}
@ -222,8 +222,8 @@ print_help (void)
{
print_revision (progname, revision);
printf (_("Copyright (c) 1999 Ethan Galstad\n"));
printf (_(COPYRIGHT), copyright, email);
printf ("Copyright (c) 1999 Ethan Galstad\n");
printf (COPYRIGHT, copyright, email);
printf (_("\
This plugin tests an UDP connection with the specified host.\n\n"));

View file

@ -472,7 +472,7 @@ process_arguments (int argc, char **argv)
server_address = optarg;
}
else {
usage2 ("Invalid host name", optarg);
usage2 (_("Invalid host name"), optarg);
}
break;
case 'u': /* ups name */
@ -538,7 +538,7 @@ process_arguments (int argc, char **argv)
if (is_host (argv[optind]))
server_address = argv[optind++];
else
usage ("Invalid host name");
usage2 (_("Invalid host name"), optarg);
}
if (server_address == NULL)
@ -570,8 +570,8 @@ print_help (void)
print_revision (progname, revision);
printf (_("Copyright (c) 2000 Tom Shields"));
printf (_(COPYRIGHT), copyright, email);
printf ("Copyright (c) 2000 Tom Shields");
printf (COPYRIGHT, copyright, email);
printf (_("This plugin tests the UPS service on the specified host.\n\
Network UPS Tools from www.exploits.org must be running for this plugin to\n\

View file

@ -192,8 +192,8 @@ print_help (void)
{
print_revision (progname, revision);
printf (_("Copyright (c) 1999 Ethan Galstad\n"));
printf (_(COPYRIGHT), copyright, email);
printf ("Copyright (c) 1999 Ethan Galstad\n");
printf (COPYRIGHT, copyright, email);
printf (_("\
This plugin checks the number of users currently logged in on the local\n\

View file

@ -180,7 +180,7 @@ process_arguments (int argc, char **argv)
exit (EXIT_SUCCESS);
case 't': /* timeout period */
if (!is_integer (optarg))
usage2 (_("Timeout Interval must be an integer"), optarg);
usage2 (_("Timeout interval must be a positive integer"), optarg);
else
timeout_interval = atoi (optarg);
break;

View file

@ -129,8 +129,8 @@ print_help (void)
{
print_revision (progname, revision);
printf (_("Copyright (c) 2000 Karl DeBisschop <kdebisschop@users.sourceforge.net>\n"));
printf (_(COPYRIGHT), copyright, email);
printf ("Copyright (c) 2000 Karl DeBisschop <kdebisschop@users.sourceforge.net>\n");
printf (COPYRIGHT, copyright, email);
printf (_("\n\
This plugin wraps the text output of another command (plugin) in HTML\n\