Przeglądaj źródła

internationalization fixes and help fixes

git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@989 f882894a-f735-0410-b71e-b25c423dba1c
Benoit Mortier 21 lat temu
rodzic
commit
fa002886e3

+ 4 - 3
plugins/check_by_ssh.c

@@ -308,7 +308,7 @@ process_arguments (int argc, char **argv)
 		asprintf (&remotecmd, "%s;echo STATUS CODE: $?;", remotecmd);
 		asprintf (&remotecmd, "%s;echo STATUS CODE: $?;", remotecmd);
 
 
 	if (remotecmd == NULL || strlen (remotecmd) <= 1)
 	if (remotecmd == NULL || strlen (remotecmd) <= 1)
-		usage (_("No remotecmd\n"));
+		usage4 (_("No remotecmd"));
 
 
 	asprintf (&comm, "%s %s '%s'", comm, hostname, remotecmd);
 	asprintf (&comm, "%s %s '%s'", comm, hostname, remotecmd);
 
 
@@ -409,9 +409,10 @@ $ cat /tmp/foo\n\
 void
 void
 print_usage (void)
 print_usage (void)
 {
 {
-	printf (_("\n\
+	printf ("\n\
 Usage: %s [-f46] [-t timeout] [-i identity] [-l user] -H <host> \n\
 Usage: %s [-f46] [-t timeout] [-i identity] [-l user] -H <host> \n\
-  -C <command> [-n name] [-s servicelist] [-O outputfile] [-p port]\n"),
+  -C <command> [-n name] [-s servicelist] [-O outputfile] [-p port]\n",
 	        progname);
 	        progname);
+					
 	printf (_(UT_HLP_VRS), progname, progname);
 	printf (_(UT_HLP_VRS), progname, progname);
 }
 }

+ 4 - 5
plugins/check_dig.c

@@ -353,11 +353,10 @@ print_help (void)
 void
 void
 print_usage (void)
 print_usage (void)
 {
 {
-	printf (_("\
+	printf ("\
 Usage: %s -H host -l lookup [-p <server port>] [-T <query type>]\n\
 Usage: %s -H host -l lookup [-p <server port>] [-T <query type>]\n\
          [-w <warning interval>] [-c <critical interval>] [-t <timeout>]\n\
          [-w <warning interval>] [-c <critical interval>] [-t <timeout>]\n\
-         [-a <expected answer address>] [-v]\n"),
-	        progname);
-	printf ("       %s (-h|--help)\n", progname);
-	printf ("       %s (-V|--version)\n", progname);
+         [-a <expected answer address>] [-v]\n", progname);
+				 
+	printf (UT_HLP_VRS, progname, progname);
 }
 }

+ 6 - 7
plugins/check_disk.c

@@ -322,7 +322,7 @@ process_arguments (int argc, char **argv)
 				break;
 				break;
 			}
 			}
 			else {
 			else {
-				usage (_("Warning threshold must be integer or percentage!\n"));
+				usage4 (_("Warning threshold must be integer or percentage!"));
 			}
 			}
 		case 'c':									/* critical threshold */
 		case 'c':									/* critical threshold */
 			if (is_intnonneg (optarg)) {
 			if (is_intnonneg (optarg)) {
@@ -339,7 +339,7 @@ process_arguments (int argc, char **argv)
 				break;
 				break;
 			}
 			}
 			else {
 			else {
-				usage (_("Critical threshold must be integer or percentage!\n"));
+				usage4 (_("Critical threshold must be integer or percentage!"));
 			}
 			}
 		case 'u':
 		case 'u':
 			if (units)
 			if (units)
@@ -636,10 +636,9 @@ and generates an alert if free space is less than one of the threshold values.")
 void
 void
 print_usage (void)
 print_usage (void)
 {
 {
-	printf (_("\
+	printf ("\
 Usage: %s -w limit -c limit [-p path | -x device] [-t timeout] [-m] [-e]\n\
 Usage: %s -w limit -c limit [-p path | -x device] [-t timeout] [-m] [-e]\n\
-        [-v] [-q]\n\
-       %s (-h|--help)\n\
-       %s (-V|--version)\n"),
-	        progname,  progname, progname);
+        [-v] [-q]\n", progname);
+
+	printf (UT_HLP_VRS, progname, progname);
 }
 }

+ 4 - 4
plugins/check_dns.c

@@ -425,8 +425,8 @@ specified in /etc/resolv.conf will be used.\n"));
 void
 void
 print_usage (void)
 print_usage (void)
 {
 {
-	printf (_("\
-Usage: %s -H host [-s server] [-a expected-address] [-A] [-t timeout]\n\
-       %s --help\n\
-       %s --version\n"), progname, progname, progname);
+	printf ("\
+Usage: %s -H host [-s server] [-a expected-address] [-A] [-t timeout]\n", progname);
+
+	printf (UT_HLP_VRS, progname, progname);
 }
 }

+ 3 - 3
plugins/check_dummy.c

@@ -41,7 +41,7 @@ main (int argc, char **argv)
 	textdomain (PACKAGE);
 	textdomain (PACKAGE);
 
 
 	if (argc < 2)
 	if (argc < 2)
-		usage (_("Incorrect number of arguments supplied\n"));
+		usage4 (_("Incorrect number of arguments supplied"));
 	else if (strcmp (argv[1], "-V") == 0 || strcmp (argv[1], "--version") == 0) {
 	else if (strcmp (argv[1], "-V") == 0 || strcmp (argv[1], "--version") == 0) {
 		print_revision (progname, revision);
 		print_revision (progname, revision);
 		exit (STATE_OK);
 		exit (STATE_OK);
@@ -51,7 +51,7 @@ main (int argc, char **argv)
 		exit (STATE_OK);
 		exit (STATE_OK);
 	}
 	}
 	else if (!is_integer (argv[1]))
 	else if (!is_integer (argv[1]))
-		usage (_("Arguments to check_dummy must be an integer\n"));
+		usage4 (_("Arguments to check_dummy must be an integer"));
 	else
 	else
 		result = atoi (argv[1]);
 		result = atoi (argv[1]);
 
 
@@ -107,5 +107,5 @@ of the <state> argument with optional text.\n"));
 void
 void
 print_usage (void)
 print_usage (void)
 {
 {
-	printf (_("Usage: %s <integer state> [optional text]\n"), progname);
+	printf ("Usage: %s <integer state> [optional text]\n", progname);
 }
 }

+ 2 - 2
plugins/check_fping.c

@@ -399,6 +399,6 @@ percentage of packet loss to trigger an alarm state.\n"));
 void
 void
 print_usage (void)
 print_usage (void)
 {
 {
-	printf (_("Usage: %s <host_address>\n"), progname);
-	printf (_(UT_HLP_VRS), progname, progname);
+	printf ("Usage: %s <host_address>\n", progname);
+	printf (UT_HLP_VRS, progname, progname);
 }
 }

+ 4 - 3
plugins/check_game.c

@@ -333,10 +333,11 @@ Notes:\n\
 void
 void
 print_usage (void)
 print_usage (void)
 {
 {
-	printf (_("\
+	printf ("\
 Usage: %s <game> <ip_address> [-p port] [-gf game_field] [-mf map_field]\n\
 Usage: %s <game> <ip_address> [-p port] [-gf game_field] [-mf map_field]\n\
-  [-pf ping_field]\n"), progname);
-	printf (_(UT_HLP_VRS), progname, progname);
+  [-pf ping_field]\n", progname);
+	
+	printf (UT_HLP_VRS, progname, progname);
 }
 }
 
 
 /******************************************************************************
 /******************************************************************************

+ 2 - 1
plugins/check_hpjd.c

@@ -400,5 +400,6 @@ print_usage (void)
 {
 {
 	printf (_("\
 	printf (_("\
 Usage: %s -H host [-C community]\n"), progname);
 Usage: %s -H host [-C community]\n"), progname);
-	printf (_(UT_HLP_VRS), progname, progname);
+
+	printf (UT_HLP_VRS, progname, progname);
 }
 }

+ 2 - 1
plugins/check_http.c

@@ -1497,5 +1497,6 @@ Usage: %s (-H <vhost> | -I <IP-address>) [-u <uri>] [-p <port>]\n\
   [-s string] [-l] [-r <regex> | -R <case-insensitive regex>]\n\
   [-s string] [-l] [-r <regex> | -R <case-insensitive regex>]\n\
   [-P string] [-m min_pg_size] [-4|-6] [-N] [-M <age>] [-A string]\n\
   [-P string] [-m min_pg_size] [-4|-6] [-N] [-M <age>] [-A string]\n\
   [-k string]\n"), progname);
   [-k string]\n"), progname);
-	printf (_(UT_HLP_VRS), progname, progname);
+	
+	printf (UT_HLP_VRS, progname, progname);
 }
 }

+ 4 - 4
plugins/check_ide-smart.c

@@ -385,7 +385,7 @@ void
 show_help () 
 show_help () 
 {
 {
 	printf (_("\
 	printf (_("\
-Usage: check_ide-smart [DEVICE] [OPTION]\n\
+Usage: %s [DEVICE] [OPTION]\n\
  -d, --device=DEVICE\n\
  -d, --device=DEVICE\n\
     Select device DEVICE\n\
     Select device DEVICE\n\
  -i, --immediate\n\
  -i, --immediate\n\
@@ -397,9 +397,9 @@ Usage: check_ide-smart [DEVICE] [OPTION]\n\
  -0, --auto-off\n\
  -0, --auto-off\n\
     Turn off automatic offline tests\n\
     Turn off automatic offline tests\n\
  -n, --net-saint\n\
  -n, --net-saint\n\
-    Output suitable for Net Saint\n\
- -h, --help\n\
- -V, --version\n"));
+    Output suitable for Net Saint\n", progname);
+	
+	printf (UT_HLP_VRS, progname, progname);
 }
 }
 
 
 
 

+ 3 - 3
plugins/check_ldap.c

@@ -333,10 +333,10 @@ print_help (void)
 void
 void
 print_usage (void)
 print_usage (void)
 {
 {
-	printf (_("\
+	printf ("\
 Usage: %s -H <host> -b <base_dn> [-p <port>] [-a <attr>] [-D <binddn>]\n\
 Usage: %s -H <host> -b <base_dn> [-p <port>] [-a <attr>] [-D <binddn>]\n\
   [-P <password>] [-w <warn_time>] [-c <crit_time>] [-t timeout]%s\n\
   [-P <password>] [-w <warn_time>] [-c <crit_time>] [-t timeout]%s\n\
-(Note: all times are in seconds.)\n"),
+(Note: all times are in seconds.)\n",
 	        progname,
 	        progname,
 #ifdef HAVE_LDAP_SET_OPTION
 #ifdef HAVE_LDAP_SET_OPTION
 			" [-2|-3] [-4|-6]"
 			" [-2|-3] [-4|-6]"
@@ -345,5 +345,5 @@ Usage: %s -H <host> -b <base_dn> [-p <port>] [-a <attr>] [-D <binddn>]\n\
 #endif
 #endif
 			);
 			);
 
 
-	printf (_(UT_HLP_VRS), progname, progname);
+	printf (UT_HLP_VRS, progname, progname);
 }
 }

+ 2 - 2
plugins/check_load.c

@@ -319,7 +319,7 @@ the load average format is the same used by \"uptime\" and \"w\"\n\n"));
 void
 void
 print_usage (void)
 print_usage (void)
 {
 {
-	printf (_("Usage: %s -w WLOAD1,WLOAD5,WLOAD15 -c CLOAD1,CLOAD5,CLOAD15\n"),
+	printf ("Usage: %s -w WLOAD1,WLOAD5,WLOAD15 -c CLOAD1,CLOAD5,CLOAD15\n"),
 	        progname);
 	        progname);
-	printf (_(UT_HLP_VRS), progname, progname);
+	printf (UT_HLP_VRS, progname, progname);
 }
 }

+ 4 - 3
plugins/check_mrtg.c

@@ -379,8 +379,9 @@ this plugin works well for monitoring that kind of data as well.\n\n"));
 void
 void
 print_usage (void)
 print_usage (void)
 {
 {
-	printf (_("\
+	printf ("\
 Usage: %s -F log_file -a <AVG | MAX> -v variable -w warning -c critical\n\
 Usage: %s -F log_file -a <AVG | MAX> -v variable -w warning -c critical\n\
-  [-l label] [-u units] [-e expire_minutes] [-t timeout] [-v]\n"), progname);
-	printf (_(UT_HLP_VRS), progname, progname);
+  [-l label] [-u units] [-e expire_minutes] [-t timeout] [-v]\n", progname);
+	
+	printf (UT_HLP_VRS, progname, progname);
 }
 }

+ 4 - 3
plugins/check_mrtgtraf.c

@@ -363,8 +363,9 @@ the <iwl> or <owl> thresholds (in Bytes/sec), a WARNING status results.\n\n"));
 void
 void
 print_usage (void)
 print_usage (void)
 {
 {
-	printf (_("\
+	printf ("\
 Usage: %s -F <log_file> -a <AVG | MAX> -v <variable> -w <warning_pair> -c <critical_pair>\n\
 Usage: %s -F <log_file> -a <AVG | MAX> -v <variable> -w <warning_pair> -c <critical_pair>\n\
-  [-e expire_minutes] [-t timeout] [-v]\n"), progname);
-	printf (_(UT_HLP_VRS), progname, progname);
+  [-e expire_minutes] [-t timeout] [-v]\n", progname);
+	
+	printf (UT_HLP_VRS, progname, progname);
 }
 }

+ 3 - 3
plugins/check_mysql.c

@@ -308,8 +308,8 @@ a server listening on MySQL standard port %d will be checked\n"), MYSQL_PORT);
 void
 void
 print_usage (void)
 print_usage (void)
 {
 {
-	printf (_("\
-Usage: %s [-d database] [-H host] [-P port] [-u user] [-p password] [-S]\n"),
+	printf ("\
+Usage: %s [-d database] [-H host] [-P port] [-u user] [-p password] [-S]\n",
 	        progname);
 	        progname);
-	printf (_(UT_HLP_VRS), progname, progname);
+	printf (UT_HLP_VRS, progname, progname);
 }
 }

+ 4 - 2
plugins/check_nagios.c

@@ -302,7 +302,9 @@ Example:\n\
 void
 void
 print_usage (void)
 print_usage (void)
 {
 {
-	printf (_("\
-Usage: %s -F <status log file> -e <expire_minutes> -C <process_string>\n"),
+	printf ("\
+Usage: %s -F <status log file> -e <expire_minutes> -C <process_string>\n",
 	        progname);
 	        progname);
+					
+	printf (UT_HLP_VRS, progname, progname);
 }
 }

+ 5 - 4
plugins/check_nt.c

@@ -607,7 +607,7 @@ void preparelist(char *string) {
 
 
 void print_help(void)
 void print_help(void)
 {
 {
-	print_revision(progname,"$Revision$");
+	print_revision(progname,revision);
 	printf (_("\
 	printf (_("\
 Copyright (c) 2000 Yves Rubin (rubiyz@yahoo.com)\n\n\
 Copyright (c) 2000 Yves Rubin (rubiyz@yahoo.com)\n\n\
 This plugin collects data from the NSClient service running on a\n\
 This plugin collects data from the NSClient service running on a\n\
@@ -682,8 +682,9 @@ Windows NT/2000/XP server.\n\n"));
 
 
 void print_usage(void)
 void print_usage(void)
 {
 {
-	printf(_("\
+	printf("\
 Usage: %s -H host -v variable [-p port] [-w warning] [-c critical]\n\
 Usage: %s -H host -v variable [-p port] [-w warning] [-c critical]\n\
-  [-l params] [-d SHOWALL] [-t timeout]\n"), progname);
-	printf (_(UT_HLP_VRS), progname, progname);
+  [-l params] [-d SHOWALL] [-t timeout]\n", progname);
+	
+	printf (UT_HLP_VRS, progname, progname);
 }
 }

+ 4 - 3
plugins/check_nwstat.c

@@ -987,8 +987,9 @@ Notes:\n\
 
 
 void print_usage(void)
 void print_usage(void)
 {
 {
-	printf (_("\
+	printf ("\
 Usage: %s -H host [-p port] [-v variable] [-w warning] [-c critical]\n\
 Usage: %s -H host [-p port] [-v variable] [-w warning] [-c critical]\n\
-  [-t timeout].\n"), progname);
-	printf (_(UT_HLP_VRS), progname, progname);
+  [-t timeout].\n", progname);
+	
+	printf (UT_HLP_VRS, progname, progname);
 }
 }