[Nagiosplug-checkins] nagiosplug/plugins check_load.c,1.22,1.23 check_pgsql.c,1.25,1.26 check_ping.c,1.35,1.36 check_procs.c,1.36,1.37 check_radius.c,1.16,1.17 check_real.c,1.19,1.20 check_smtp.c,1.33,1.34 check_snmp.c,1.44,1.45 check_ssh.c,1.21,1.22 check_swap.c,1.36,1.37 check_tcp.c,1.50,1.51 check_time.c,1.19,1.20 check_udp.c,1.19,1.20 check_ups.c,1.21,1.22 check_users.c,1.15,1.16 urlize.c,1.14,1.15

Benoit Mortier opensides at users.sourceforge.net
Fri Dec 3 08:57:03 CET 2004


Update of /cvsroot/nagiosplug/nagiosplug/plugins
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30655/plugins

Modified Files:
	check_load.c check_pgsql.c check_ping.c check_procs.c 
	check_radius.c check_real.c check_smtp.c check_snmp.c 
	check_ssh.c check_swap.c check_tcp.c check_time.c check_udp.c 
	check_ups.c check_users.c urlize.c 
Log Message:

fixes for internationalization



Index: check_tcp.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_tcp.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -d -r1.50 -r1.51
--- check_tcp.c	3 Dec 2004 00:55:28 -0000	1.50
+++ check_tcp.c	3 Dec 2004 16:56:27 -0000	1.51
@@ -793,12 +793,12 @@
 void
 print_usage (void)
 {
-	printf (_("\
+	printf ("\
 Usage: %s -H host -p port [-w <warning time>] [-c <critical time>]\n\
   [-s <send string>] [-e <expect string>] [-q <quit string>]\n\
   [-m <maximum bytes>] [-d <delay>] [-t <timeout seconds>]\n\
   [-r <refuse state>] [-v] [-4|-6] [-j] [-D <days to cert expiry>]\n\
-  [-S <use SSL>]\n"), progname);
-	printf ("       %s (-h|--help)\n", progname);
-	printf ("       %s (-V|--version)\n", progname);
+  [-S <use SSL>]\n", progname);
+	
+	printf (UT_HLP_VRS, progname, progname);
 }

Index: check_procs.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_procs.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- check_procs.c	3 Dec 2004 04:10:19 -0000	1.36
+++ check_procs.c	3 Dec 2004 16:56:27 -0000	1.37
@@ -589,6 +589,71 @@
 
 
 
+
+/* convert the elapsed time to seconds */
+int
+convert_to_seconds(char *etime) {
+
+	char *ptr;
+	int total;
+
+	int hyphcnt;
+	int coloncnt;
+	int days;
+	int hours;
+	int minutes;
+	int seconds;
+
+	hyphcnt = 0;
+	coloncnt = 0;
+	days = 0;
+	hours = 0;
+	minutes = 0;
+	seconds = 0;
+
+	for (ptr = etime; *ptr != '\0'; ptr++) {
+	
+		if (*ptr == '-') {
+			hyphcnt++;
+			continue;
+		}
+		if (*ptr == ':') {
+			coloncnt++;
+			continue;
+		}
+	}
+
+	if (hyphcnt > 0) {
+		sscanf(etime, "%d-%d:%d:%d",
+				&days, &hours, &minutes, &seconds);
+		/* linux 2.6.5/2.6.6 reporting some processes with infinite
+		 * elapsed times for some reason */
+		if (days == 49710) {
+			return 0;
+		}
+	} else {
+		if (coloncnt == 2) {
+			sscanf(etime, "%d:%d:%d",
+				&hours, &minutes, &seconds);
+		} else if (coloncnt == 1) {
+			sscanf(etime, "%d:%d",
+				&minutes, &seconds);
+		}
+	}
+
+	total = (days * 86400) +
+		(hours * 3600) +
+		(minutes * 60) +
+		seconds;
+
+	if (verbose >= 3) {
+		printf("seconds: %d\n", total);
+	}
+	return total;
+}
+
+
+
 void
 print_help (void)
 {
@@ -681,78 +746,13 @@
 	printf (_(UT_SUPPORT));
 }
 
-
-
-/* convert the elapsed time to seconds */
-int
-convert_to_seconds(char *etime) {
-
-	char *ptr;
-	int total;
-
-	int hyphcnt;
-	int coloncnt;
-	int days;
-	int hours;
-	int minutes;
-	int seconds;
-
-	hyphcnt = 0;
-	coloncnt = 0;
-	days = 0;
-	hours = 0;
-	minutes = 0;
-	seconds = 0;
-
-	for (ptr = etime; *ptr != '\0'; ptr++) {
-	
-		if (*ptr == '-') {
-			hyphcnt++;
-			continue;
-		}
-		if (*ptr == ':') {
-			coloncnt++;
-			continue;
-		}
-	}
-
-	if (hyphcnt > 0) {
-		sscanf(etime, "%d-%d:%d:%d",
-				&days, &hours, &minutes, &seconds);
-		/* linux 2.6.5/2.6.6 reporting some processes with infinite
-		 * elapsed times for some reason */
-		if (days == 49710) {
-			return 0;
-		}
-	} else {
-		if (coloncnt == 2) {
-			sscanf(etime, "%d:%d:%d",
-				&hours, &minutes, &seconds);
-		} else if (coloncnt == 1) {
-			sscanf(etime, "%d:%d",
-				&minutes, &seconds);
-		}
-	}
-
-	total = (days * 86400) +
-		(hours * 3600) +
-		(minutes * 60) +
-		seconds;
-
-	if (verbose >= 3) {
-		printf("seconds: %d\n", total);
-	}
-	return total;
-}
-
 void
 print_usage (void)
 {
 	printf ("\
 Usage: %s -w <range> -c <range> [-m metric] [-s state] [-p ppid]\n\
   [-u user] [-r rss] [-z vsz] [-P %%cpu] [-a argument-array]\n\
-  [-C command] [-t timeout] [-v]\n", progname);	
-	printf (_(UT_HLP_VRS), progname, progname);
+  [-C command] [-t timeout] [-v]\n", progname);
+	
+	printf (UT_HLP_VRS, progname, progname);
 }
-
-

Index: check_real.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_real.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- check_real.c	3 Dec 2004 00:55:27 -0000	1.19
+++ check_real.c	3 Dec 2004 16:56:27 -0000	1.20
@@ -439,5 +439,6 @@
 	printf ("\
 Usage: %s -H host [-e expect] [-p port] [-w warn] [-c crit]\n\
   [-t timeout] [-v]\n", progname);
-	printf (_(UT_HLP_VRS), progname, progname);
+	
+	printf (UT_HLP_VRS, progname, progname);
 }

Index: check_radius.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_radius.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- check_radius.c	3 Dec 2004 00:55:27 -0000	1.16
+++ check_radius.c	3 Dec 2004 16:56:27 -0000	1.17
@@ -336,5 +336,5 @@
 	printf ("\
 Usage: %s -H host -F config_file -u username -p password [-n nas-id] [-P port]\n\
   [-t timeout] [-r retries] [-e expect]\n", progname);
-	printf (_(UT_HLP_VRS), progname, progname);
+	printf (UT_HLP_VRS, progname, progname);
 }

Index: check_snmp.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_snmp.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- check_snmp.c	3 Dec 2004 00:55:28 -0000	1.44
+++ check_snmp.c	3 Dec 2004 16:56:27 -0000	1.45
@@ -948,12 +948,13 @@
 void
 print_usage (void)
 {
-	printf (_("\
+	printf ("\
 Usage: %s -H <ip_address> -o <OID> [-w warn_range] [-c crit_range] \n\
   [-C community] [-s string] [-r regex] [-R regexi] [-t timeout]\n\
   [-l label] [-u units] [-p port-number] [-d delimiter]\n\
   [-D output-delimiter] [-m miblist] [-P snmp version]\n\
   [-L seclevel] [-U secname] [-a authproto] [-A authpasswd]\n\
-  [-X privpasswd]\n"), progname);
-	printf (_(UT_HLP_VRS), progname, progname);
+  [-X privpasswd]\n", progname);
+	
+	printf (UT_HLP_VRS, progname, progname);
 }

Index: check_ups.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_ups.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- check_ups.c	3 Dec 2004 00:55:28 -0000	1.21
+++ check_ups.c	3 Dec 2004 16:56:27 -0000	1.22
@@ -647,8 +647,8 @@
 void
 print_usage (void)
 {
-	printf (_("\
+	printf ("\
 Usage: %s -H host -u ups [-p port] [-v variable]\n\
-  [-wv warn_value] [-cv crit_value] [-to to_sec] [-T]\n"), progname);
-	printf (_(UT_HLP_VRS), progname, progname);
+  [-wv warn_value] [-cv crit_value] [-to to_sec] [-T]\n", progname);
+	printf (UT_HLP_VRS, progname, progname);
 }

Index: check_pgsql.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_pgsql.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- check_pgsql.c	3 Dec 2004 09:19:18 -0000	1.25
+++ check_pgsql.c	3 Dec 2004 16:56:27 -0000	1.26
@@ -441,12 +441,9 @@
 void
 print_usage (void)
 {
-	printf (S_("\
-Usage:\n %s [-H <host>] [-P <port>] [-c <critical time>] [-w <warning time>]\n\
-            [-t <timeout>]"), progname);
-	printf (S_("[-d <database>] [-l <logname>] [-p <password>]\n"));
-	printf (S_("\
-         %s (-h | --help) for detailed help\n\
-         %s (-V | --version) for version information\n"),
-					progname, progname);
+	printf ("\
+Usage: %s [-H <host>] [-P <port>] [-c <critical time>] [-w <warning time>]\n\
+            [-t <timeout>] [-d <database>] [-l <logname>] [-p <password>]\n", progname);
+						
+	printf (UT_HLP_VRS, progname, progname);
 }

Index: check_time.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_time.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- check_time.c	3 Dec 2004 00:55:28 -0000	1.19
+++ check_time.c	3 Dec 2004 16:56:27 -0000	1.20
@@ -357,8 +357,9 @@
 void
 print_usage (void)
 {
-	printf (_("\
+	printf ("\
 Usage: %s -H <host_address> [-p port] [-u] [-w variance] [-c variance]\n\
-    [-W connect_time] [-C connect_time] [-t timeout]\n"), progname);
+    [-W connect_time] [-C connect_time] [-t timeout]\n", progname);
+		
 	printf (_(UT_HLP_VRS), progname, progname);
 }

Index: check_smtp.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_smtp.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- check_smtp.c	3 Dec 2004 00:55:28 -0000	1.33
+++ check_smtp.c	3 Dec 2004 16:56:27 -0000	1.34
@@ -469,5 +469,5 @@
 	printf ("\
 Usage: %s -H host [-p port] [-e expect] [-C command] [-f from addr]\n\
   [-w warn] [-c crit] [-t timeout] [-n] [-v] [-4|-6]\n", progname);
-	printf (_(UT_HLP_VRS), progname, progname);
+	printf (UT_HLP_VRS, progname, progname);
 }

Index: check_ssh.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_ssh.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- check_ssh.c	3 Dec 2004 00:55:28 -0000	1.21
+++ check_ssh.c	3 Dec 2004 16:56:27 -0000	1.22
@@ -287,9 +287,9 @@
 void
 print_usage (void)
 {
-	printf (_("\
+	printf ("\
 Usage: %s [-46] [-t <timeout>] [-r <remote version>] [-p <port>] <host>\n"), progname);
-	printf (_(UT_HLP_VRS), progname, progname);
+
+	printf (UT_HLP_VRS, progname, progname);
 }
 
-/* end of check_ssh.c */

Index: check_udp.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_udp.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- check_udp.c	3 Dec 2004 09:19:18 -0000	1.19
+++ check_udp.c	3 Dec 2004 16:56:27 -0000	1.20
@@ -225,7 +225,7 @@
 	printf (COPYRIGHT, copyright, email);
 
 	printf (_("\
-This plugin tests an UDP connection with the specified host.\n\n"));
+	This plugin tests an UDP connection with the specified host.\n\n"));
 
 	print_usage ();
 
@@ -262,8 +262,9 @@
 void
 print_usage (void)
 {
-	printf (_("\
+	printf ("\
 Usage: %s -H <host_address> [-p port] [-w warn_time] [-c crit_time]\n\
-    [-e expect] [-s send] [-t to_sec] [-v]\n"), progname);
-	printf (_(UT_HLP_VRS), progname, progname);
+    [-e expect] [-s send] [-t to_sec] [-v]\n", progname);
+		
+	printf (UT_HLP_VRS, progname, progname);
 }

Index: check_users.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_users.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- check_users.c	3 Dec 2004 00:55:28 -0000	1.15
+++ check_users.c	3 Dec 2004 16:56:27 -0000	1.16
@@ -215,5 +215,6 @@
 print_usage (void)
 {
 	printf ("Usage: %s -w <users> -c <users>\n", progname);
-	printf (_(UT_HLP_VRS), progname, progname);
+	
+	printf (UT_HLP_VRS, progname, progname);
 }

Index: check_ping.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_ping.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- check_ping.c	3 Dec 2004 09:19:18 -0000	1.35
+++ check_ping.c	3 Dec 2004 16:56:27 -0000	1.36
@@ -485,17 +485,6 @@
 
 
 void
-print_usage (void)
-{
-	printf (\
-"Usage: %s -H <host_address> -w <wrta>,<wpl>%% -c <crta>,<cpl>%%\n\
-  [-p packets] [-t timeout] [-L] [-4|-6]\n", progname);
-	printf (_(UT_HLP_VRS), progname, progname);
-}
-
-
-
-void
 print_help (void)
 {
 	print_revision (progname, revision);
@@ -539,3 +528,12 @@
 
 	printf (_(UT_SUPPORT));
 }
+
+void
+print_usage (void)
+{
+	printf ("Usage: %s -H <host_address> -w <wrta>,<wpl>%% -c <crta>,<cpl>%%\n\
+  [-p packets] [-t timeout] [-L] [-4|-6]\n", progname);
+	
+	printf (UT_HLP_VRS, progname, progname);
+}

Index: check_load.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_load.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- check_load.c	3 Dec 2004 11:45:09 -0000	1.22
+++ check_load.c	3 Dec 2004 16:56:27 -0000	1.23
@@ -321,5 +321,6 @@
 {
 	printf ("Usage: %s -w WLOAD1,WLOAD5,WLOAD15 -c CLOAD1,CLOAD5,CLOAD15\n"),
 	        progname);
+					
 	printf (UT_HLP_VRS, progname, progname);
 }

Index: urlize.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/urlize.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- urlize.c	3 Dec 2004 00:55:28 -0000	1.14
+++ urlize.c	3 Dec 2004 16:56:27 -0000	1.15
@@ -162,5 +162,7 @@
 void
 print_usage (void)
 {
-	printf (_("Usage:\n %s <url> <plugin> <arg1> ... <argN>\n"), progname);
+	printf ("Usage:\n %s <url> <plugin> <arg1> ... <argN>\n", progname);
+	
+	printf (UT_HLP_VRS, progname, progname);
 }

Index: check_swap.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_swap.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- check_swap.c	3 Dec 2004 00:55:28 -0000	1.36
+++ check_swap.c	3 Dec 2004 16:56:27 -0000	1.37
@@ -514,10 +514,9 @@
 void
 print_usage (void)
 {
-	printf (_("Usage:\n\
+	printf ("Usage:\n\
  %s [-av] -w <percent_free>%% -c <percent_free>%%\n\
- %s [-av] -w <bytes_free> -c <bytes_free>\n\
- %s (-h | --help) for detailed help\n\
- %s (-V | --version) for version information\n"),
-	        progname, progname, progname, progname);
+ %s [-av] -w <bytes_free> -c <bytes_free>\n", progname, progname);
+ 
+ printf (UT_HLP_VRS, progname, progname);
 }





More information about the Commits mailing list