[Nagiosplug-checkins] nagiosplug/plugins check_dig.c,1.38,1.39 check_disk.c,1.55,1.56 check_dns.c,1.45,1.46 check_dummy.c,1.13,1.14 check_fping.c,1.23,1.24 check_game.c,1.21,1.22 check_hpjd.c,1.30,1.31 check_icmp.c,1.3,1.4 check_ide_smart.c,1.2,1.3 check_ldap.c,1.29,1.30 check_load.c,1.26,1.27 check_mrtg.c,1.23,1.24 check_mrtgtraf.c,1.23,1.24 check_mysql.c,1.23,1.24 check_nagios.c,1.24,1.25 check_nt.c,1.37,1.38 check_nwstat.c,1.28,1.29 check_overcr.c,1.18,1.19 check_pgsql.c,1.30,1.31 check_ping.c,1.39,1.40 check_procs.c,1.41,1.42 check_radius.c,1.20,1.21 check_real.c,1.24,1.25 check_smtp.c,1.39,1.40 check_snmp.c,1.50,1.51 check_ssh.c,1.25,1.26 check_swap.c,1.43,1.44 check_tcp.c,1.59,1.60 check_time.c,1.24,1.25 check_udp.c,1.24,1.25 check_ups.c,1.25,1.26 check_users.c,1.18,1.19 negate.c,1.23,1.24 netutils.c,1.21,1.22 popen.c,1.10,1.11 popen.h,1.2,1.3 urlize.c,1.16,1.17 utils.c,1.40,1.41

Benoit Mortier opensides at users.sourceforge.net
Sat Dec 25 15:19:08 CET 2004


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

Modified Files:
	check_dig.c check_disk.c check_dns.c check_dummy.c 
	check_fping.c check_game.c check_hpjd.c check_icmp.c 
	check_ide_smart.c check_ldap.c check_load.c check_mrtg.c 
	check_mrtgtraf.c check_mysql.c check_nagios.c check_nt.c 
	check_nwstat.c check_overcr.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 negate.c netutils.c 
	popen.c popen.h urlize.c utils.c 
Log Message:

various fixes for localization



Index: check_mrtg.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_mrtg.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- check_mrtg.c	4 Dec 2004 12:12:29 -0000	1.23
+++ check_mrtg.c	25 Dec 2004 23:17:44 -0000	1.24
@@ -233,9 +233,7 @@
 			print_help ();
 			exit (STATE_OK);
 		case '?':									/* help */
-			printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
-			print_usage ();
-			exit (STATE_UNKNOWN);
+			usage2 (_("Unknown argument"), optarg);
 		}
 	}
 

Index: check_icmp.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_icmp.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- check_icmp.c	24 Dec 2004 18:06:05 -0000	1.3
+++ check_icmp.c	25 Dec 2004 23:17:44 -0000	1.4
@@ -310,19 +310,19 @@
 	
 	/* check if we are root */
 	if(geteuid()) {
-		printf("Root access needed (for raw sockets)\n");
+		printf(_("Root access needed (for raw sockets)\n"));
 		exit(STATE_UNKNOWN);
 	}
 
 	/* confirm that ICMP is available on this machine */
 	if((proto = getprotobyname("icmp")) == NULL)
-		crash("icmp: unknown protocol");
+		crash(_("icmp: unknown protocol"));
 
 	/* create raw socket for ICMP calls (ping) */
 	sock = socket(AF_INET, SOCK_RAW, proto->p_proto);
 
 	if(sock < 0)
-		crash("can't create raw socket");
+		crash(_("Can't create raw socket"));
 
 	/* drop privileges now that we have the socket */
 	if((uid = getuid())) {
@@ -334,7 +334,7 @@
 	ident = getpid() & 0xFFFF;
 
 	if(!(host_base_ptr = malloc(sizeof(struct host_name_list)))) {
-		crash("Unable to allocate memory for host name list\n");
+		crash(_("Unable to allocate memory for host name list\n"));
 	}
 	host_ptr = host_base_ptr;
 
@@ -359,12 +359,12 @@
 		switch (c) {
 			case 'H':
 				if(!(host_ptr->entry = malloc(strlen(optarg) + 1))) {
-					crash("Failed to allocate memory for hostname");
+					crash(_("Failed to allocate memory for hostname"));
 				}
 				memset(host_ptr->entry, 0, strlen(optarg) + 1);
 				host_ptr->entry = memcpy(host_ptr->entry, optarg, strlen(optarg));
 				if(!(host_ptr->next = malloc(sizeof(struct host_name_list))))
-					crash("Failed to allocate memory for hostname");
+					crash(_("Failed to allocate memory for hostname"));
 				host_ptr = host_ptr->next;
 				host_ptr->next = NULL;
 //				add_name(optarg);
@@ -375,35 +375,35 @@
 				break;
 			case 'w':
 				if(get_threshold(optarg, &warn)) {
-					printf("Illegal threshold pair specified for -%c", c);
+					printf(_("Illegal threshold pair specified for -%c"), c);
 					print_usage();
 				}
 				break;
 
 			case 'c':
 				if(get_threshold(optarg, &crit)) {
-					printf("Illegal threshold pair specified for -%c", c);
+					printf(_("Illegal threshold pair specified for -%c"), c);
 					print_usage();
 				}
 				break;
 
 			case 't':
 				if(!(timeout = (u_int) strtoul(optarg, NULL, 0) * 100)) {
-					printf("option -%c requires integer argument\n", c);
+					printf(_("Option -%c requires integer argument\n"), c);
 					print_usage();
 				}
 				break;
 
 			case 'r':
 				if(!(retry = (u_int) strtoul(optarg, NULL, 0))) {
-					printf("option -%c requires integer argument\n", c);
+					printf(_("Option -%c requires integer argument\n"), c);
 					print_usage();
 				}
 				break;
 
 			case 'i':
 				if(!(interval = (u_int) strtoul(optarg, NULL, 0) * 100)) {
-					printf("option -%c requires positive non-zero integer argument\n", c);
+					printf(_("Option -%c requires positive non-zero integer argument\n"), c);
 					print_usage();
 				}
 				break;
@@ -411,14 +411,14 @@
 			case 'p':
 			case 'n':
 				if(!(count = (u_int) strtoul(optarg, NULL, 0))) {
-					printf("option -%c requires positive non-zero integer argument\n", c);
+					printf(_("Option -%c requires positive non-zero integer argument\n"), c);
 					print_usage();
 				}
 				break;
 
 			case 'b':
 				if(!(ping_data_size = (u_int) strtoul(optarg, NULL, 0))) {
-					printf("option -%c requires integer argument\n", c);
+					printf(_("Option -%c requires integer argument\n"), c);
 					print_usage();
 				}
 				break;
@@ -467,7 +467,7 @@
 				break;
 
 			default:
-				printf("option flag -%c specified, but not recognized\n", c);
+				printf(_("Option flag -%c specified, but not recognized\n"), c);
 				print_usage();
 				break;
 		}
@@ -494,30 +494,30 @@
 	else if(timeout < warn.rta) timeout = warn.rta;
 
 	if((interval < MIN_INTERVAL * 100 || retry > MAX_RETRY) && getuid()) {
-		printf("%s: these options are too risky for mere mortals.\n", prog);
-		printf("%s: You need i >= %u and r < %u\n",
+		printf(_("%s: these options are too risky for mere mortals.\n"), prog);
+		printf(_("%s: You need i >= %u and r < %u\n"),
 				prog, MIN_INTERVAL, MAX_RETRY);
-		printf("Current settings; i = %d, r = %d\n",
+		printf(_("Current settings; i = %d, r = %d\n"),
 			   interval / 100, retry);
 		print_usage();
 	}
 
 	if((ping_data_size > MAX_PING_DATA) || (ping_data_size < MIN_PING_DATA)) {
-		printf("%s: data size %u not valid, must be between %u and %u\n",
+		printf(_("%s: data size %u not valid, must be between %u and %u\n"),
 				prog, ping_data_size, MIN_PING_DATA, MAX_PING_DATA);
 		print_usage();
 
 	}
 
 	if((backoff > MAX_BACKOFF_FACTOR) || (backoff < MIN_BACKOFF_FACTOR)) {
-		printf("%s: backoff factor %.1f not valid, must be between %.1f and %.1f\n",
+		printf(_("%s: backoff factor %.1f not valid, must be between %.1f and %.1f\n"),
 				prog, backoff, MIN_BACKOFF_FACTOR, MAX_BACKOFF_FACTOR);
 		print_usage();
 
 	}
 
 	if(count > MAX_COUNT) {
-		printf("%s: count %u not valid, must be less than %u\n",
+		printf(_("%s: count %u not valid, must be less than %u\n"),
 				prog, count, MAX_COUNT);
 		print_usage();
 	}
@@ -536,19 +536,19 @@
 
 	/* generate requires command line parameters beyond the switches */
 	if(generate_flag && !*argv) {
-		printf("generate flag requires command line parameters beyond switches\n");
+		printf(_("Generate flag requires command line parameters beyond switches\n"));
 		print_usage();
 	}
 
 	if(*argv && !generate_flag) {
 		while(*argv) {
 			if(!(host_ptr->entry = malloc(strlen(*argv) + 1))) {
-				crash("Failed to allocate memory for hostname");
+				crash(_("Failed to allocate memory for hostname"));
 			}
 			memset(host_ptr->entry, 0, strlen(*argv) + 1);
 			host_ptr->entry = memcpy(host_ptr->entry, *argv, strlen(*argv));
 			if(!(host_ptr->next = malloc(sizeof(struct host_name_list))))
-				crash("Failed to allocate memory for hostname");
+				crash(_("Failed to allocate memory for hostname"));
 			host_ptr = host_ptr->next;
 			host_ptr->next = NULL;
 
@@ -565,13 +565,13 @@
 	}
 
 	if(!num_hosts) {
-		printf("No hosts to work with!\n\n");
+		printf(_("No hosts to work with!\n\n"));
 		print_usage();
 	}
 
 	/* allocate array to hold outstanding ping requests */
 	table = (HOST_ENTRY **) malloc(sizeof(HOST_ENTRY *) * num_hosts);
-	if(!table) crash("Can't malloc array of hosts");
+	if(!table) crash(_("Can't malloc array of hosts"));
 
 	cursor = rrlist;
 
@@ -703,7 +703,7 @@
 					   warn.pl, crit.pl);
 			}
 			else {
-				printf("%s is down (lost 100%%)", h->host);
+				printf(_("%s is down (lost 100%%)"), h->host);
 			}
 		}
 		else {
@@ -754,7 +754,7 @@
 	}
 
 	if(num_noaddress) {
-		printf("No hostaddress specified.\n");
+		printf(_("No hostaddress specified.\n"));
 		print_usage();
 	}
 	else if(num_alive != num_hosts) {
@@ -765,10 +765,10 @@
 
 	if(num_hosts > 1) {
 		if(num_alive == num_hosts) {
-			printf("OK - All %d hosts are alive\n", num_hosts);
+			printf(_("OK - All %d hosts are alive\n"), num_hosts);
 		}
 		else {
-			printf("CRITICAL - %d of %d hosts are alive\n", num_alive, num_hosts);
+			printf(_("CRITICAL - %d of %d hosts are alive\n"), num_alive, num_hosts);
 		}
 	}
 	exit(fin_stat);
@@ -784,7 +784,7 @@
 
 	buffer = (char *)malloc((size_t) ping_pkt_size);
 	if(!buffer)
-		crash("can't malloc ping packet");
+		crash(_("Can't malloc ping packet"));
 
 	memset(buffer, 0, ping_pkt_size * sizeof(char));
 	icp = (struct icmp *)buffer;
@@ -808,7 +808,7 @@
 
 	if(n < 0 || (unsigned int)n != ping_pkt_size) {
 		if(unreachable_flag) {
-			printf("%s error while sending ping: %s\n",
+			printf(_("%s error while sending ping: %s\n"),
 				   h->host, strerror(errno));
 		}			/* IF */
 
@@ -860,7 +860,7 @@
 #endif /* defined(__alpha__) && __STDC__ */
 
 	if(result < hlen + ICMP_MINLEN) {
-		printf("received packet too short for ICMP (%d bytes from %s)\n", result,
+		printf(_("Received packet too short for ICMP (%d bytes from %s)\n"), result,
 			   inet_ntoa(response_addr.sin_addr));
 
 		return (1);				/* too short */
@@ -903,7 +903,7 @@
 	/* note reply time in array, probably */
 	if((this_count >= 0) && ((unsigned int)this_count < trials)) {
 		if(h->resp_times[this_count] != RESP_WAITING) {
-			printf("%s : duplicate for [%d], %d bytes, %s ms",
+			printf(_("%s : duplicate for [%d], %d bytes, %s ms"),
 				   h->host, this_count, result, sprint_tm(this_reply));
 
 			if(response_addr.sin_addr.s_addr != h->saddr.sin_addr.s_addr)
@@ -913,7 +913,7 @@
 	}						/* IF */
 	else {
 		/* count is out of bounds?? */
-		printf("%s : duplicate for [%d], %d bytes, %s ms\n",
+		printf(_("%s : duplicate for [%d], %d bytes, %s ms\n"),
 			   h->host, this_count, result, sprint_tm(this_reply));
 		}						/* ELSE */
 	
@@ -942,12 +942,12 @@
 			h = table[sent_icmp->icmp_seq];
 
 			if(p->icmp_code > ICMP_UNREACH_MAXTYPE) {
-				printf("ICMP Unreachable (Invalid Code) from %s for ICMP Echo sent to %s",
+				printf(_("ICMP Unreachable (Invalid Code) from %s for ICMP Echo sent to %s"),
 						inet_ntoa(addr->sin_addr), h->host);
 
 			}					/* IF */
 			else {
-				printf("ICMP Unreachable from %s for ICMP Echo sent to %s",
+				printf(_("ICMP Unreachable from %s for ICMP Echo sent to %s"),
 					   inet_ntoa(addr->sin_addr), h->host);
 
 			}					/* ELSE */
@@ -971,7 +971,7 @@
 		   (sent_icmp->icmp_seq < (n_short) num_hosts)) {
 			/* this is a response to a ping we sent */
 			h = table[sent_icmp->icmp_seq];
-			printf("ICMP Unreachable from %s for ICMP Echo sent to %s",
+			printf(_("ICMP Unreachable from %s for ICMP Echo sent to %s"),
 					inet_ntoa(addr->sin_addr), h->host);
 
 			if(inet_addr(h->host) == INADDR_NONE)
@@ -1056,7 +1056,7 @@
 		}						/* IF */
 
 		if(host_ent == NULL) {
-			printf("%s address not found\n", name);
+			printf(_("%s address not found\n"), name);
 			num_noaddress++;
 			return;
 		}						/* IF */
@@ -1064,7 +1064,7 @@
 
 	host_add = (struct in_addr *)*(host_ent->h_addr_list);
 	if(host_add == NULL) {
-		printf("%s has no address data\n", name);
+		printf(_("%s has no address data\n"), name);
 		num_noaddress++;
 		return;
 	}							/* IF */
@@ -1097,7 +1097,7 @@
 	nm = (char *)malloc(strlen(name) + strlen(as) + 4);
 
 	if(!nm)
-		crash("can't allocate some space for a string");
+		crash(_("Can't allocate some space for a string"));
 
 	strcpy(nm, name);
 	strcat(nm, " (");
@@ -1116,7 +1116,7 @@
 	int *i;
 
 	if(!(p = (HOST_ENTRY *) malloc(sizeof(HOST_ENTRY)))) {
-		crash("can't allocate HOST_ENTRY");
+		crash(_("Can't allocate HOST_ENTRY"));
 	}
 
 	memset((char *)p, 0, sizeof(HOST_ENTRY));
@@ -1129,7 +1129,7 @@
 
 	/* array for response time results */
 	if(!(i = (int *)malloc(trials * sizeof(int)))) {
-		crash("can't allocate resp_times array");
+		crash(_("Can't allocate resp_times array"));
 	}
 
 	for(n = 1; n < trials; n++)
@@ -1193,7 +1193,7 @@
 
 	if(string) {
 		dst = (char *)malloc(1 + strlen(string));
-		if(!dst) crash("malloc() failed!");
+		if(!dst) crash(_("malloc() failed!"));
 
 		strcpy(dst, string);
 		return dst;
@@ -1210,7 +1210,7 @@
 		if(errno)
 			printf("%s: %s : %s\n", prog, msg, strerror(errno));
 		if(h_errno)
-			printf("%s: %s : A network error occurred\n", prog, msg);
+			printf(_("%s: %s : A network error occurred\n"), prog, msg);
 	}
 	else printf("%s: %s\n", prog, msg);
 
@@ -1276,7 +1276,7 @@
 	FD_ZERO(&readset);
 	nfound = select(0, &readset, &writeset, NULL, &to);
 	if(nfound < 0)
-		crash("select() in u_sleep:");
+		crash(_("select() in u_sleep:"));
 
 	return;
 }								/* u_sleep() */
@@ -1306,14 +1306,14 @@
 	FD_ZERO(&writeset);
 	FD_SET(lsock, &readset);
 	nfound = select(lsock + 1, &readset, &writeset, NULL, &to);
-	if(nfound < 0) crash("select() in recvfrom_wto");
+	if(nfound < 0) crash(_("select() in recvfrom_wto"));
 
 	if(nfound == 0) return -1;				/* timeout */
 
 	if(nfound) {
 		slen = sizeof(struct sockaddr);
 		n = recvfrom(sock, buf, len, 0, saddr, &slen);
-		if(n < 0) crash("recvfrom");
+		if(n < 0) crash(_("recvfrom"));
 		return(n);
 	}
 

Index: check_tcp.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_tcp.c,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -d -r1.59 -r1.60
--- check_tcp.c	11 Dec 2004 06:25:07 -0000	1.59
+++ check_tcp.c	25 Dec 2004 23:17:44 -0000	1.60
@@ -259,13 +259,13 @@
 #ifdef HAVE_SSL
 	if (use_ssl && check_cert == TRUE) {
 	  if (connect_SSL () != OK)
-	    die (STATE_CRITICAL,"CRITICAL - Could not make SSL connection\n");
+	    die (STATE_CRITICAL,_("CRITICAL - Could not make SSL connection\n"));
 	  if ((server_cert = SSL_get_peer_certificate (ssl)) != NULL) {
 	    result = check_certificate (&server_cert);
 	    X509_free(server_cert);
 	  }
 	  else {
-	    printf("CRITICAL - Cannot retrieve server certificate.\n");
+	    printf(_("CRITICAL - Cannot retrieve server certificate.\n"));
 	    result = STATE_CRITICAL;
 	  }
 	  SSL_shutdown (ssl);
@@ -434,7 +434,7 @@
 	};
 
 	if (argc < 2)
-		usage ("No arguments found\n");
+		usage4 (_("No arguments found"));
 
 	/* backwards compatibility */
 	for (c = 1; c < argc; c++) {
@@ -462,14 +462,12 @@
 
 		switch (c) {
 		case '?':                 /* print short usage statement if args not parsable */
-			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);
 		case 'V':                 /* version */
-			print_revision (progname, "$Revision$");
+			print_revision (progname, revision);
 			exit (STATE_OK);
 		case 'v':                 /* verbose mode */
 			verbose = TRUE;
@@ -575,7 +573,7 @@
                  case 'D': /* Check SSL cert validity - days 'til certificate expiration */
 #ifdef HAVE_SSL
 			if (!is_intnonneg (optarg))
-				usage2 ("invalid certificate expiration period", optarg);
+				usage2 (_("Invalid certificate expiration period"), optarg);
 			days_till_exp = atoi (optarg);
 			check_cert = TRUE;
 			use_ssl = TRUE;
@@ -583,14 +581,14 @@
 		case 'S':
 			use_ssl = TRUE;
 #else
-			die (STATE_UNKNOWN, "SSL support not available.  Install OpenSSL and recompile.");
+			die (STATE_UNKNOWN, _("SSL support not available.  Install OpenSSL and recompile."));
 #endif
 			break;
 		}
 	}
 
 	if (server_address == NULL)
-		usage (_("You must provide a server address\n"));
+		usage4 (_("You must provide a server address"));
 
 	return TRUE;
 }
@@ -669,7 +667,7 @@
   /* Generate tm structure to process timestamp */
   if (tm->type == V_ASN1_UTCTIME) {
     if (tm->length < 10) {
-      printf ("CRITICAL - Wrong time format in certificate.\n");
+      printf (_("CRITICAL - Wrong time format in certificate.\n"));
       return STATE_CRITICAL;
     }
     else {
@@ -681,7 +679,7 @@
   }
   else {
     if (tm->length < 12) {
-      printf ("CRITICAL - Wrong time format in certificate.\n");
+      printf (_("CRITICAL - Wrong time format in certificate.\n"));
       return STATE_CRITICAL;
     }
     else {
@@ -710,20 +708,20 @@
 	   stamp.tm_mday, stamp.tm_year + 1900, stamp.tm_hour, stamp.tm_min);
 
         if (days_left > 0 && days_left <= days_till_exp) {
-	  printf ("Certificate expires in %d day(s) (%s).\n", days_left, timestamp);
+	  printf (_("Certificate expires in %d day(s) (%s).\n"), days_left, timestamp);
 	  return STATE_WARNING;
         }
         if (days_left < 0) {
-	  printf ("Certificate expired on %s.\n", timestamp);
+	  printf (_("Certificate expired on %s.\n"), timestamp);
 	  return STATE_CRITICAL;
         }
 
         if (days_left == 0) {
-	  printf ("Certificate expires today (%s).\n", timestamp);
+	  printf (_("Certificate expires today (%s).\n"), timestamp);
 	  return STATE_WARNING;
         }
 
-        printf ("Certificate will expire on %s.\n", timestamp);
+        printf (_("Certificate will expire on %s.\n"), timestamp);
 
         return STATE_OK;
 }

Index: check_dummy.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_dummy.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- check_dummy.c	3 Dec 2004 23:02:02 -0000	1.13
+++ check_dummy.c	25 Dec 2004 23:17:44 -0000	1.14
@@ -30,7 +30,6 @@
 void print_usage (void);
 
 
-
 int
 main (int argc, char **argv)
 {

Index: check_overcr.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_overcr.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- check_overcr.c	4 Dec 2004 12:12:29 -0000	1.18
+++ check_overcr.c	25 Dec 2004 23:17:44 -0000	1.19
@@ -272,17 +272,9 @@
 		die (STATE_UNKNOWN, _("Nothing to check!\n"));
 		break;
 	}
-
-	/* reset timeout */
-/* 	alarm (0); */
-
-/* 	printf (_("Reached end of program with no data returned\n")); */
-
-/* 	return result; */
 }
 
 
-
 /* process command-line arguments */
 int
 process_arguments (int argc, char **argv)
@@ -332,9 +324,7 @@
 
 		switch (c) {
 		case '?':									/* print short usage statement if args not parsable */
-			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);
@@ -349,8 +339,7 @@
 				server_port = atoi (optarg);
 			else
 				die (STATE_UNKNOWN,
-									 _("Server port an integer (seconds)\nType '%s -h' for additional help\n"),
-									 progname);
+									 _("Server port an integer\n"));
 			break;
 		case 'v':									/* variable */
 			if (strcmp (optarg, "LOAD") == 0) {
@@ -403,7 +392,6 @@
 }
 
 
-
 void
 print_help (void)
 {
@@ -459,7 +447,6 @@
 }
 
 
-
 void
 print_usage (void)
 {

Index: check_radius.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_radius.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- check_radius.c	3 Dec 2004 23:55:29 -0000	1.20
+++ check_radius.c	25 Dec 2004 23:17:44 -0000	1.21
@@ -199,12 +199,12 @@
 		if (is_intpos (argv[5]))
 			retries = atoi (argv[5]);
 		else
-			usage (_("Number of retries must be a positive integer"));
+			usage4 (_("Number of retries must be a positive integer"));
 		server = argv[6];
 		if (is_intpos (argv[7]))
 			port = atoi (argv[7]);
 		else
-			usage (_("Port must be a positive integer"));
+			usage4 (_("Port must be a positive integer"));
 		expect = argv[8];
 		return OK;
 	}
@@ -218,9 +218,7 @@
 
 		switch (c) {
 		case '?':									/* print short usage statement if args not parsable */
-			printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
-			print_usage ();
-			exit (STATE_UNKNOWN);
+			usage2 (_("Unknown argument"), optarg);
 		case 'h':									/* help */
 			print_help ();
 			exit (OK);
@@ -240,7 +238,7 @@
 			if (is_intnonneg (optarg))
 				port = atoi (optarg);
 			else
-				usage (_("Port must be a positive integer"));
+				usage4 (_("Port must be a positive integer"));
 			break;
 		case 'u':									/* username */
 			username = optarg;
@@ -261,7 +259,7 @@
 			if (is_intpos (optarg))
 				retries = atoi (optarg);
 			else
-				usage (_("Number of retries must be a positive integer"));
+				usage4 (_("Number of retries must be a positive integer"));
 			break;
 		case 't':									/* timeout */
 			if (is_intpos (optarg))

Index: check_mrtgtraf.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_mrtgtraf.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- check_mrtgtraf.c	3 Dec 2004 23:55:28 -0000	1.23
+++ check_mrtgtraf.c	25 Dec 2004 23:17:44 -0000	1.24
@@ -260,9 +260,7 @@
 			print_help ();
 			exit (STATE_OK);
 		case '?':									/* help */
-			printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
-			print_usage ();
-			exit (STATE_UNKNOWN);
+			usage2 (_("Unknown argument"), optarg);
 		}
 	}
 
@@ -304,7 +302,6 @@
 }
 
 
-
 int
 validate_arguments (void)
 {
@@ -312,7 +309,6 @@
 }
 
 
-
 void
 print_help (void)
 {

Index: check_ups.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_ups.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- check_ups.c	3 Dec 2004 23:55:29 -0000	1.25
+++ check_ups.c	25 Dec 2004 23:17:44 -0000	1.26
@@ -133,48 +133,48 @@
 		}
 		else if ((status & (UPSSTATUS_OB | UPSSTATUS_LB)) ==
 						 (UPSSTATUS_OB | UPSSTATUS_LB)) {
-			asprintf (&ups_status, "On Battery, Low Battery");
+			asprintf (&ups_status, _("On Battery, Low Battery"));
 			result = STATE_CRITICAL;
 		}
 		else {
 			if (status & UPSSTATUS_OL) {
-				asprintf (&ups_status, "%s%s", ups_status, "Online");
+				asprintf (&ups_status, "%s%s", ups_status, _("Online"));
 			}
 			if (status & UPSSTATUS_OB) {
-				asprintf (&ups_status, "%s%s", ups_status, "On Battery");
+				asprintf (&ups_status, "%s%s", ups_status, _("On Battery"));
 				result = STATE_WARNING;
 			}
 			if (status & UPSSTATUS_LB) {
-				asprintf (&ups_status, "%s%s", ups_status, ", Low Battery");
+				asprintf (&ups_status, "%s%s", ups_status, _(", Low Battery"));
 				result = STATE_WARNING;
 			}
 			if (status & UPSSTATUS_CAL) {
-				asprintf (&ups_status, "%s%s", ups_status, ", Calibrating");
+				asprintf (&ups_status, "%s%s", ups_status, _(", Calibrating"));
 			}
 			if (status & UPSSTATUS_RB) {
-				asprintf (&ups_status, "%s%s", ups_status, ", Replace Battery");
+				asprintf (&ups_status, "%s%s", ups_status, _(", Replace Battery"));
 				result = STATE_WARNING;
 			}
 			if (status & UPSSTATUS_BYPASS) {
-				asprintf (&ups_status, "%s%s", ups_status, ", On Bypass");
+				asprintf (&ups_status, "%s%s", ups_status, _(", On Bypass"));
 			}
 			if (status & UPSSTATUS_OVER) {
-				asprintf (&ups_status, "%s%s", ups_status, ", Overload");
+				asprintf (&ups_status, "%s%s", ups_status, _(", Overload"));
 			}
 			if (status & UPSSTATUS_TRIM) {
-				asprintf (&ups_status, "%s%s", ups_status, ", Trimming");
+				asprintf (&ups_status, "%s%s", ups_status, _(", Trimming"));
 			}
 			if (status & UPSSTATUS_BOOST) {
-				asprintf (&ups_status, "%s%s", ups_status, ", Boosting");
+				asprintf (&ups_status, "%s%s", ups_status, _(", Boosting"));
 			}
 			if (status & UPSSTATUS_CHRG) {
-				asprintf (&ups_status, "%s%s", ups_status, ", Charging");
+				asprintf (&ups_status, "%s%s", ups_status, _(", Charging"));
 			}
 			if (status & UPSSTATUS_DISCHRG) {
-				asprintf (&ups_status, "%s%s", ups_status, ", Discharging");
+				asprintf (&ups_status, "%s%s", ups_status, _(", Discharging"));
 			}
 			if (status & UPSSTATUS_UNKOWN) {
-				asprintf (&ups_status, "%s%s", ups_status, ", Unknown");
+				asprintf (&ups_status, "%s%s", ups_status, _(", Unknown"));
 			}
 		}
 		asprintf (&message, "%sStatus=%s ", message, ups_status);
@@ -311,7 +311,7 @@
 	/* if the UPS does not support any options we are looking for, report an error */
 	if (supported_options == UPS_NONE) {
 		result = STATE_CRITICAL;
-		asprintf (&message, "UPS does not support any available options\n");
+		asprintf (&message, _("UPS does not support any available options\n"));
 	}
 
 	/* reset timeout */
@@ -335,7 +335,7 @@
 	res=get_ups_variable ("ups.status", recv_buffer, sizeof (recv_buffer));
 	if (res == NOSUCHVAR) return OK;
 	if (res != STATE_OK) {
-		printf ("Invalid response received from host\n");
+		printf (_("Invalid response received from host\n"));
 		return ERROR;
 	}
 
@@ -395,7 +395,7 @@
 	if (process_tcp_request
 			(server_address, server_port, send_buffer, temp_buffer,
 			 sizeof (temp_buffer)) != STATE_OK) {
-		printf ("Invalid response received from host\n");
+		printf (_("Invalid response received from host\n"));
 		return ERROR;
 	}
 
@@ -403,7 +403,7 @@
 	len = strlen(ptr);
 	if (len > 0 && ptr[len-1] == '\n') ptr[len-1]=0;
 	if (strcmp (ptr, "ERR UNKNOWN-UPS") == 0) {
-		printf ("CRITICAL - no such ups '%s' on that host\n", ups_name);
+		printf (_("CRITICAL - no such ups '%s' on that host\n"), ups_name);
 		return ERROR;
 	}
 
@@ -413,19 +413,19 @@
 	}
 
 	if (strcmp (ptr, "ERR DATA-STALE") == 0) {
-		printf ("CRITICAL - UPS data is stale\n");
+		printf (_("CRITICAL - UPS data is stale\n"));
 		return ERROR;
 	}
 
 	if (strncmp (ptr, "ERR", 3) == 0) {
-		printf ("Unknown error: %s\n", ptr);
+		printf (_("Unknown error: %s\n"), ptr);
 		return ERROR;
 	}
 
 	ptr = temp_buffer + strlen (varname) + strlen (ups_name) + 6;
 	len = strlen(ptr);
 	if (len < 2 || ptr[0] != '"' || ptr[len-1] != '"') {
-		printf ("Error: unable to parse variable\n");
+		printf (_("Error: unable to parse variable\n"));
 		return ERROR;
 	}
 	strncpy (buf, ptr+1, len - 2);
@@ -481,9 +481,7 @@
 
 		switch (c) {
 		case '?':									/* help */
-			printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
-			print_usage ();
-			exit (STATE_UNKNOWN);
+			usage2 (_("Unknown argument"), optarg);
 		case 'H':									/* hostname */
 			if (is_host (optarg)) {
 				server_address = optarg;
@@ -503,7 +501,7 @@
 				server_port = atoi (optarg);
 			}
 			else {
-				usage2 ("Port must be a positive integer", optarg);
+				usage2 (_("Port must be a positive integer"), optarg);
 			}
 			break;
 		case 'c':									/* critical time threshold */
@@ -512,7 +510,7 @@
 				check_crit = TRUE;
 			}
 			else {
-				usage2 ("Critical time must be a positive integer", optarg);
+				usage2 (_("Critical time must be a positive integer"), optarg);
 			}
 			break;
 		case 'w':									/* warning time threshold */
@@ -521,7 +519,7 @@
 				check_warn = TRUE;
 			}
 			else {
-				usage2 ("Warning time must be a positive integer", optarg);
+				usage2 (_("Warning time must be a positive integer"), optarg);
 			}
 			break;
 		case 'v':									/* variable */
@@ -534,14 +532,14 @@
 			else if (!strcmp (optarg, "LOADPCT"))
 				check_variable = UPS_LOADPCT;
 			else
-				usage2 ("Unrecognized UPS variable", optarg);
+				usage2 (_("Unrecognized UPS variable"), optarg);
 			break;
 		case 't':									/* timeout */
 			if (is_intnonneg (optarg)) {
 				socket_timeout = atoi (optarg);
 			}
 			else {
-				usage ("Time interval must be a positive integer\n");
+				usage4 (_("Timeout interval must be a positive integer"));
 			}
 			break;
 		case 'V':									/* version */
@@ -568,19 +566,17 @@
 }
 
 
-
 int
 validate_arguments (void)
 {
 	if (! ups_name) {
-		printf ("Error : no ups indicated\n");
+		printf (_("Error : no ups indicated\n"));
 		return ERROR;
 	}
 	return OK;
 }
 
 
-
 void
 print_help (void)
 {
@@ -641,7 +637,6 @@
 }
 
 
-
 void
 print_usage (void)
 {

Index: check_time.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_time.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- check_time.c	4 Dec 2004 12:12:29 -0000	1.24
+++ check_time.c	25 Dec 2004 23:17:44 -0000	1.25
@@ -216,9 +216,7 @@
 
 		switch (c) {
 		case '?':									/* print short usage statement if args not parsable */
-			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);

Index: check_dig.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_dig.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- check_dig.c	4 Dec 2004 12:12:29 -0000	1.38
+++ check_dig.c	25 Dec 2004 23:17:38 -0000	1.39
@@ -81,9 +81,9 @@
 	if (verbose) {
 		printf ("%s\n", command_line);
 		if(expected_address != NULL) {
-			printf ("Looking for: '%s'\n", expected_address);
+			printf (_("Looking for: '%s'\n"), expected_address);
 		} else {
-			printf ("Looking for: '%s'\n", query_address);
+			printf (_("Looking for: '%s'\n"), query_address);
 		}
 	}
 
@@ -214,9 +214,7 @@
 
 		switch (c) {
 		case '?':									/* help */
-			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);

Index: check_ssh.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_ssh.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- check_ssh.c	3 Dec 2004 23:55:29 -0000	1.25
+++ check_ssh.c	25 Dec 2004 23:17:44 -0000	1.26
@@ -110,9 +110,7 @@
 
 		switch (c) {
 		case '?':									/* help */
-			printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
-			print_usage ();
-			exit (STATE_UNKNOWN);
+			usage2 (_("Unknown argument"), optarg);
 		case 'V':									/* version */
 			print_revision (progname, revision);
 			exit (STATE_OK);
@@ -135,7 +133,7 @@
 #ifdef USE_IPV6
 			address_family = AF_INET6;
 #else
-			usage (_("IPv6 support not available\n"));
+			usage4 (_("IPv6 support not available"));
 #endif
 			break;
 		case 'r':									/* remote version */
@@ -151,11 +149,9 @@
 				port = atoi (optarg);
 			}
 			else {
-				printf ("Port number nust be a positive integer: %s\n", optarg);
-				usage ("");
+				usage2 (_("Port number must be a positive integer"), optarg);
 			}
 		}
-
 	}
 
 	c = optind;

Index: check_udp.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_udp.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- check_udp.c	4 Dec 2004 12:12:29 -0000	1.24
+++ check_udp.c	25 Dec 2004 23:17:44 -0000	1.25
@@ -67,7 +67,7 @@
 	time (&end_time);
 
 	if (result != STATE_OK) {
-		printf ("No response from host on port %d\n", server_port);
+		printf (_("No response from host on port %d\n"), server_port);
 		result = STATE_CRITICAL;
 	}
 
@@ -76,7 +76,7 @@
 		/* check to see if we got the response we wanted */
 		if (server_expect) {
 			if (!strstr (recv_buffer, server_expect)) {
-				printf ("Invalid response received from host on port %d\n",
+				printf (_("Invalid response received from host on port %d\n"),
 								server_port);
 				result = STATE_CRITICAL;
 			}
@@ -146,9 +146,7 @@
 
 		switch (c) {
 		case '?':									/* print short usage statement if args not parsable */
-			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);
@@ -254,8 +252,6 @@
 }
 
 
-
-
 /* Original Command line: 
    check_udp <host_address> [-p port] [-s send] [-e expect] \
    [-wt warn_time] [-ct crit_time] [-to to_sec] */

Index: check_fping.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_fping.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- check_fping.c	3 Dec 2004 23:55:28 -0000	1.23
+++ check_fping.c	25 Dec 2004 23:17:44 -0000	1.24
@@ -242,9 +242,7 @@
 
 		switch (c) {
 		case '?':									/* print short usage statement if args not parsable */
-			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);
@@ -301,15 +299,13 @@
 		}
 	}
 
-
 	if (server_name == NULL)
-		usage (_("Hostname was not supplied\n\n"));
+		usage4 (_("Hostname was not supplied"));
 
 	return OK;
 }
 
 
-
 int
 get_threshold (char *arg, char *rv[2])
 {
@@ -351,7 +347,6 @@
 }
 
 
-
 void
 print_help (void)
 {
@@ -395,7 +390,6 @@
 }
 
 
-
 void
 print_usage (void)
 {

Index: check_users.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_users.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- check_users.c	3 Dec 2004 23:55:29 -0000	1.18
+++ check_users.c	25 Dec 2004 23:17:44 -0000	1.19
@@ -140,9 +140,7 @@
 
 		switch (c) {
 		case '?':									/* print short usage statement if args not parsable */
-			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);
@@ -151,13 +149,13 @@
 			exit (STATE_OK);
 		case 'c':									/* critical */
 			if (!is_intnonneg (optarg))
-				usage (_("Critical threshold must be a positive integer\n"));
+				usage4 (_("Critical threshold must be a positive integer"));
 			else
 				cusers = atoi (optarg);
 			break;
 		case 'w':									/* warning */
 			if (!is_intnonneg (optarg))
-				usage (_("Warning threshold must be a positive integer\n"));
+				usage4 (_("Warning threshold must be a positive integer"));
 			else
 				wusers = atoi (optarg);
 			break;
@@ -167,14 +165,14 @@
 	c = optind;
 	if (wusers == -1 && argc > c) {
 		if (is_intnonneg (argv[c]) == FALSE)
-			usage (_("Warning threshold must be a positive integer\n"));
+			usage4 (_("Warning threshold must be a positive integer"));
 		else
 			wusers = atoi (argv[c++]);
 	}
 
 	if (cusers == -1 && argc > c) {
 		if (is_intnonneg (argv[c]) == FALSE)
-			usage (_("Warning threshold must be a positive integer\n"));
+			usage4 (_("Warning threshold must be a positive integer"));
 		else
 			cusers = atoi (argv[c]);
 	}
@@ -210,7 +208,6 @@
 }
 
 
-
 void
 print_usage (void)
 {

Index: check_ping.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_ping.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- check_ping.c	5 Dec 2004 00:54:09 -0000	1.39
+++ check_ping.c	25 Dec 2004 23:17:44 -0000	1.40
@@ -194,9 +194,7 @@
 
 		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);

Index: check_dns.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_dns.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -d -r1.45 -r1.46
--- check_dns.c	21 Dec 2004 05:00:46 -0000	1.45
+++ check_dns.c	25 Dec 2004 23:17:44 -0000	1.46
@@ -135,7 +135,7 @@
 				asprintf(&address, "%s,%s", address, temp_buffer);
 		}
 
-		else if (strstr (input_buffer, "Non-authoritative answer:")) {
+		else if (strstr (input_buffer, _("Non-authoritative answer:"))) {
 			non_authoritative = TRUE;
 		}
 
@@ -277,7 +277,6 @@
 }
 
 
-
 /* process command-line arguments */
 int
 process_arguments (int argc, char **argv)
@@ -313,9 +312,7 @@
 
 		switch (c) {
 		case '?': /* args not parsable */
-			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);
@@ -386,7 +383,6 @@
 }
 
 
-
 int
 validate_arguments ()
 {
@@ -397,7 +393,6 @@
 }
 
 
-
 void
 print_help (void)
 {
@@ -432,7 +427,6 @@
 }
 
 
-
 void
 print_usage (void)
 {

Index: check_swap.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_swap.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- check_swap.c	5 Dec 2004 00:54:09 -0000	1.43
+++ check_swap.c	25 Dec 2004 23:17:44 -0000	1.44
@@ -239,7 +239,7 @@
 	/* and now, tally 'em up */
 	swapctl_res=swapctl(SC_LIST, tbl);
 	if(swapctl_res < 0){
-		perror("swapctl failed: ");
+		perror(_("swapctl failed: "));
 		result = STATE_WARNING;
 	}
 
@@ -278,7 +278,7 @@
 	/* and now, tally 'em up */
 	swapctl_res=swapctl(SWAP_STATS, ent, nswaps);
 	if(swapctl_res < 0){
-		perror("swapctl failed: ");
+		perror(_("swapctl failed: "));
 		result = STATE_WARNING;
 	}
 
@@ -388,7 +388,7 @@
 				break;
 			}
 			else {
-				usage (_("Warning threshold must be integer or percentage!\n"));
+				usage4 (_("Warning threshold must be integer or percentage!"));
 			}
 		case 'c':									/* critical size threshold */
 			if (is_intnonneg (optarg)) {
@@ -420,9 +420,7 @@
 			print_help ();
 			exit (STATE_OK);
 		case '?':									/* error */
-			printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
-			print_usage ();
-			exit (STATE_UNKNOWN);
+			usage2 (_("Unknown argument"), optarg);
 		}
 	}
 

Index: check_ide_smart.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_ide_smart.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- check_ide_smart.c	8 Dec 2004 00:36:19 -0000	1.2
+++ check_ide_smart.c	25 Dec 2004 23:17:44 -0000	1.3
@@ -206,9 +206,7 @@
 			print_revision (progname, revision);
 			return STATE_OK;
 		default:
-			printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
-			print_usage ();
-			exit (STATE_UNKNOWN);
+			usage2 (_("Unknown argument"), optarg);
 		}
 
 		if (optind < argc) {
@@ -488,7 +486,6 @@
 }
 
 
-
 void
 print_help () 
 {
@@ -515,7 +512,6 @@
 }
 
 
-
 void
 print_usage (void)
 {

Index: check_hpjd.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_hpjd.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- check_hpjd.c	4 Dec 2004 10:57:12 -0000	1.30
+++ check_hpjd.c	25 Dec 2004 23:17:44 -0000	1.31
@@ -286,7 +286,6 @@
 }
 
 
-
 /* process command-line arguments */
 int
 process_arguments (int argc, char **argv)
@@ -334,9 +333,7 @@
 			print_help ();
 			exit (STATE_OK);
 		case '?':									/* help */
-			printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
-			print_usage ();
-			exit (STATE_UNKNOWN);
+			usage2 (_("Unknown argument"), optarg);
 		}
 	}
 
@@ -361,7 +358,6 @@
 }
 
 
-
 int
 validate_arguments (void)
 {
@@ -369,7 +365,6 @@
 }
 
 
-
 void
 print_help (void)
 {

Index: check_snmp.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_snmp.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -d -r1.50 -r1.51
--- check_snmp.c	8 Dec 2004 00:36:19 -0000	1.50
+++ check_snmp.c	25 Dec 2004 23:17:44 -0000	1.51
@@ -251,7 +251,7 @@
 		    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]);
@@ -398,9 +398,7 @@
 
 		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); 
@@ -795,7 +793,7 @@
 	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;
 }

Index: check_real.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_real.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- check_real.c	4 Dec 2004 12:12:29 -0000	1.24
+++ check_real.c	25 Dec 2004 23:17:44 -0000	1.25
@@ -330,7 +330,7 @@
 				check_critical_time = TRUE;
 			}
 			else {
-				usage4 (_("Critical time must be a nonnegative integer"));
+				usage4 (_("Critical time must be a positive integer"));
 			}
 			break;
 		case 'v':									/* verbose */
@@ -341,7 +341,7 @@
 				socket_timeout = atoi (optarg);
 			}
 			else {
-				usage4 (_("Time interval must be a nonnegative integer"));
+				usage4 (_("Timeout interval must be a positive integer"));
 			}
 			break;
 		case 'V':									/* version */
@@ -351,9 +351,7 @@
 			print_help ();
 			exit (STATE_OK);
 		case '?':									/* usage */
-			printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
-			print_usage ();
-			exit (STATE_UNKNOWN);
+			usage2 (_("Unknown argument"), optarg);
 		}
 	}
 
@@ -368,7 +366,7 @@
 	}
 
 	if (server_address==NULL)
-		usage (_("You must provide a server to check\n"));
+		usage4 (_("You must provide a server to check"));
 
 	if (host_name==NULL)
 		host_name = strdup (server_address);

Index: popen.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/popen.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- popen.c	2 Dec 2004 16:51:25 -0000	1.10
+++ popen.c	25 Dec 2004 23:17:44 -0000	1.11
@@ -114,7 +114,7 @@
 	argv = malloc (sizeof(char*)*argc);
 	
 	if (argv == NULL) {
-		printf ("Could not malloc argv array in popen()\n");
+		printf (_("Could not malloc argv array in popen()\n"));
 		return NULL;
 	}
 
@@ -124,7 +124,7 @@
 		str += strspn (str, " \t\r\n");	/* trim any leading whitespace */
 
 		if (i >= argc - 2) {
-			printf ("CRITICAL - You need more args!!!\n");
+			printf (_("CRITICAL - You need more args!!!\n"));
 			return (NULL);
 		}
 
@@ -239,17 +239,19 @@
 #define	OPEN_MAX_GUESS	256			/* if OPEN_MAX is indeterminate */
 				/* no guarantee this is adequate */
 
+
 void
 popen_timeout_alarm_handler (int signo)
 {
 	if (signo == SIGALRM) {
 		kill (childpid[fileno (child_process)], SIGKILL);
-		printf ("CRITICAL - Plugin timed out after %d seconds\n",
+		printf (_("CRITICAL - Plugin timed out after %d seconds\n"),
 						timeout_interval);
 		exit (STATE_CRITICAL);
 	}
 }
 
+
 int
 open_max (void)
 {
@@ -259,14 +261,13 @@
 			if (errno == 0)
 				openmax = OPEN_MAX_GUESS;	/* it's indeterminate */
 			else
-				err_sys ("sysconf error for _SC_OPEN_MAX");
+				err_sys (_("sysconf error for _SC_OPEN_MAX"));
 		}
 	}
 	return (openmax);
 }
 
 
-
 /* Fatal error related to a system call.
  * Print a message and die. */
 
@@ -309,4 +310,3 @@
 	}
 	return str;
 }
-

Index: netutils.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/netutils.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- netutils.c	1 Dec 2004 23:54:51 -0000	1.21
+++ netutils.c	25 Dec 2004 23:17:44 -0000	1.22
@@ -45,9 +45,9 @@
 socket_timeout_alarm_handler (int sig)
 {
 	if (sig == SIGALRM)
-		printf ("CRITICAL - Socket timeout after %d seconds\n", socket_timeout);
+		printf (_("CRITICAL - Socket timeout after %d seconds\n"), socket_timeout);
 	else
-		printf ("CRITICAL - Abnormal timeout after %d seconds\n", socket_timeout);
+		printf (_("CRITICAL - Abnormal timeout after %d seconds\n"), socket_timeout);
 
 	exit (STATE_CRITICAL);
 }
@@ -106,7 +106,7 @@
 
 	send_result = send (sd, send_buffer, strlen (send_buffer), 0);
 	if (send_result<0 || (size_t)send_result!=strlen(send_buffer)) {
-		printf ("Send failed\n");
+		printf (_("Send failed\n"));
 		result = STATE_WARNING;
 	}
 
@@ -123,7 +123,7 @@
 		if (!FD_ISSET (sd, &readfds)) {	/* it hasn't */
 			if (!recv_length) {
 				strcpy (recv_buffer, "");
-				printf ("No data was received from host!\n");
+				printf (_("No data was received from host!\n"));
 				result = STATE_WARNING;
 			}
 			else {										/* this one failed, but previous ones worked */
@@ -239,7 +239,7 @@
 			              SOCK_DGRAM : SOCK_STREAM, res->ai_protocol);
 
 			if (*sd < 0) {
-				printf ("Socket creation failed\n");
+				printf (_("Socket creation failed\n"));
 				freeaddrinfo (res);
 				return STATE_UNKNOWN;
 			}
@@ -315,7 +315,7 @@
 
 	send_result = send (sd, send_buffer, strlen (send_buffer), 0);
 	if (send_result<0 || (size_t)send_result!=strlen(send_buffer)) {
-		printf ("Send failed\n");
+		printf (_("Send failed\n"));
 		result = STATE_WARNING;
 	}
 
@@ -330,7 +330,7 @@
 	/* make sure some data has arrived */
 	if (!FD_ISSET (sd, &readfds)) {
 		strcpy (recv_buffer, "");
-		printf ("No data was received from host!\n");
+		printf (_("No data was received from host!\n"));
 		result = STATE_WARNING;
 	}
 
@@ -339,7 +339,7 @@
 		if (recv_result == -1) {
 			strcpy (recv_buffer, "");
 			if (proto != IPPROTO_TCP)
-				printf ("Receive failed\n");
+				printf (_("Receive failed\n"));
 			result = STATE_WARNING;
 		}
 		else

Index: check_mysql.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_mysql.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- check_mysql.c	3 Dec 2004 23:55:28 -0000	1.23
+++ check_mysql.c	25 Dec 2004 23:17:44 -0000	1.24
@@ -98,25 +98,25 @@
 		/* check the slave status */
 		if (mysql_query (&mysql, "show slave status") != 0) {
 			mysql_close (&mysql);
-			die (STATE_CRITICAL, "slave query error: %s\n", mysql_error (&mysql));
+			die (STATE_CRITICAL, _("slave query error: %s\n"), mysql_error (&mysql));
 		}
 
 		/* store the result */
 		if ( (res = mysql_store_result (&mysql)) == NULL) {
 			mysql_close (&mysql);
-			die (STATE_CRITICAL, "slave store_result error: %s\n", mysql_error (&mysql));
+			die (STATE_CRITICAL, _("slave store_result error: %s\n"), mysql_error (&mysql));
 		}
 
 		/* fetch the first row */
 		if ( (row = mysql_fetch_row (res)) == NULL) {
 			mysql_free_result (res);
 			mysql_close (&mysql);
-			die (STATE_CRITICAL, "slave fetch row error: %s\n", mysql_error (&mysql));
+			die (STATE_CRITICAL, _("slave fetch row error: %s\n"), mysql_error (&mysql));
 		}
 
 		if (mysql_field_count (&mysql) == 12) {
 			/* mysql 3.23.x */
-			snprintf (slaveresult, SLAVERESULTSIZE, "Slave running: %s", row[6]);
+			snprintf (slaveresult, SLAVERESULTSIZE, _("Slave running: %s"), row[6]);
 			if (strcmp (row[6], "Yes") != 0) {
 				mysql_free_result (res);
 				mysql_close (&mysql);
@@ -151,7 +151,6 @@
 }
 
 
-
 /* process command-line arguments */
 int
 process_arguments (int argc, char **argv)
@@ -212,9 +211,7 @@
 			print_help ();
 			exit (STATE_OK);
 		case '?':									/* help */
-			printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
-			print_usage ();
-			exit (STATE_UNKNOWN);
+			usage2 (_("Unknown argument"), optarg);
 		}
 	}
 
@@ -245,7 +242,6 @@
 }
 
 
-
 int
 validate_arguments (void)
 {
@@ -265,7 +261,6 @@
 }
 
 
-
 void
 print_help (void)
 {
@@ -304,7 +299,6 @@
 }
 
 
-
 void
 print_usage (void)
 {

Index: check_ldap.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_ldap.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- check_ldap.c	10 Dec 2004 21:18:01 -0000	1.29
+++ check_ldap.c	25 Dec 2004 23:17:44 -0000	1.30
@@ -134,11 +134,11 @@
  			if (ldap_set_option (ld, LDAP_OPT_X_TLS, &tls) != LDAP_SUCCESS)
  			{
  				/*ldap_perror(ld, "ldaps_option"); */
- 				printf ("Could not init TLS at port %i!\n", ld_port);
+ 				printf (_("Could not init TLS at port %i!\n"), ld_port);
 				return STATE_CRITICAL;
    		}
 #else
-			printf ("TLS not supported by the libraries!\n", ld_port);
+			printf (_("TLS not supported by the libraries!\n"), ld_port);
 			return STATE_CRITICAL;
 #endif /* LDAP_OPT_X_TLS */
 		} else {
@@ -157,11 +157,11 @@
 			if (ldap_start_tls_s(ld, NULL, NULL) != LDAP_SUCCESS)
 			{
 				/*ldap_perror(ld, "ldap_start_tls"); */
-				printf ("Could not init startTLS at port %i!\n", ld_port);
+				printf (_("Could not init startTLS at port %i!\n"), ld_port);
 				return STATE_CRITICAL;
 			}
 #else
-			printf ("startTLS not supported by the library, needs LDAPv3!\n");
+			printf (_("startTLS not supported by the library, needs LDAPv3!\n"));
 			return STATE_CRITICAL;
 #endif /* HAVE_LDAP_START_TLS_S */
 		}
@@ -312,9 +312,7 @@
 #endif
 			break;
 		default:
-			printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
-			print_usage ();
-			exit (STATE_UNKNOWN);
+			usage2 (_("Unknown argument"), optarg);
 		}
 	}
 
@@ -328,21 +326,20 @@
 	return validate_arguments ();
 }
 
+
 int
 validate_arguments ()
 {
 	if (ld_host==NULL || strlen(ld_host)==0)
-		usage (_("please specify the host name\n"));
+		usage4 (_("Please specify the host name\n"));
 
 	if (ld_base==NULL || strlen(ld_base)==0)
-		usage (_("please specify the LDAP base\n"));
+		usage4 (_("Please specify the LDAP base\n"));
 
 	return OK;
-
 }
 
 
-
 void
 print_help (void)
 {
@@ -392,7 +389,6 @@
 }
 
 
-
 void
 print_usage (void)
 {

Index: popen.h
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/popen.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- popen.h	8 Aug 2003 04:33:21 -0000	1.2
+++ popen.h	25 Dec 2004 23:17:44 -0000	1.3
@@ -1,3 +1,9 @@
+/******************************************************************************
+ *
+ * $Id$
+ *
+ ******************************************************************************/
+
 FILE *spopen (const char *);
 int spclose (FILE *);
 RETSIGTYPE popen_timeout_alarm_handler (int);

Index: check_disk.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_disk.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -d -r1.55 -r1.56
--- check_disk.c	3 Dec 2004 23:55:28 -0000	1.55
+++ check_disk.c	25 Dec 2004 23:17:44 -0000	1.56
@@ -438,9 +438,7 @@
 			print_help ();
 			exit (STATE_OK);
 		case '?':									/* help */
-			printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
-			print_usage ();
-			exit (STATE_UNKNOWN);
+			usage2 (_("Unknown argument"), optarg);
 		}
 	}
 
@@ -488,7 +486,7 @@
 	if (mypath == NULL)
 		printf ("\n");
 	else
-		printf (" for %s\n", mypath);
+		printf (_(" for %s\n"), mypath);
 
 	return;
 }

Index: check_nwstat.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_nwstat.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- check_nwstat.c	5 Dec 2004 00:54:09 -0000	1.28
+++ check_nwstat.c	25 Dec 2004 23:17:44 -0000	1.29
@@ -760,9 +760,7 @@
 		switch (c)
 			{
 			case '?': /* print short usage statement if args not parsable */
-				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);
@@ -779,7 +777,7 @@
 				if (is_intnonneg(optarg))
 					server_port=atoi(optarg);
 				else
-					die(STATE_UNKNOWN,_("Server port an integer (seconds)\nType '%s -h' for additional help\n"),progname);
+					die(STATE_UNKNOWN,_("Server port an integer\n"));
 				break;
 			case 'v':
 				if (strlen(optarg)<3)

Index: check_pgsql.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_pgsql.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- check_pgsql.c	10 Dec 2004 05:54:01 -0000	1.30
+++ check_pgsql.c	25 Dec 2004 23:17:44 -0000	1.31
@@ -209,9 +209,7 @@
 
 		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);
@@ -232,7 +230,7 @@
 			break;
 		case 'w':     /* warning time threshold */
 			if (!is_nonnegative (optarg))
-				usage2 (_("Critical threshold must be a positive integer"), optarg);
+				usage2 (_("Warning threshold must be a positive integer"), optarg);
 			else
 				twarn = strtod (optarg, NULL);
 			break;

Index: check_smtp.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_smtp.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- check_smtp.c	5 Dec 2004 00:54:09 -0000	1.39
+++ check_smtp.c	25 Dec 2004 23:17:44 -0000	1.40
@@ -351,7 +351,7 @@
 				socket_timeout = atoi (optarg);
 			}
 			else {
-				usage4 (_("Time interval must be a positive integer"));
+				usage4 (_("Timeout interval must be a positive integer"));
 			}
 			break;
 		case '4':
@@ -371,9 +371,7 @@
 			print_help ();
 			exit (STATE_OK);
 		case '?':									/* help */
-			printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
-			print_usage ();
-			exit (STATE_UNKNOWN);
+			usage2 (_("Unknown argument"), optarg);
 		}
 	}
 

Index: check_game.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_game.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- check_game.c	8 Dec 2004 00:36:19 -0000	1.21
+++ check_game.c	25 Dec 2004 23:17:44 -0000	1.22
@@ -123,15 +123,15 @@
 	}
 
 	if (strstr (ret[2], QSTAT_HOST_ERROR)) {
-		printf ("CRITICAL - Host not found\n");
+		printf (_("CRITICAL - Host not found\n"));
 		result = STATE_CRITICAL;
 	}
 	else if (strstr (ret[2], QSTAT_HOST_DOWN)) {
-		printf ("CRITICAL - Game server down or unavailable\n");
+		printf (_("CRITICAL - Game server down or unavailable\n"));
 		result = STATE_CRITICAL;
 	}
 	else if (strstr (ret[2], QSTAT_HOST_TIMEOUT)) {
-		printf ("CRITICAL - Game server timeout\n");
+		printf (_("CRITICAL - Game server timeout\n"));
 		result = STATE_CRITICAL;
 	}
 	else {
@@ -156,7 +156,6 @@
 }
 
 
-
 int
 process_arguments (int argc, char **argv)
 {
@@ -199,9 +198,7 @@
 
 		switch (c) {
 		case '?': /* args not parsable */
-			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);
@@ -269,6 +266,7 @@
 	return validate_arguments ();
 }
 
+
 int
 validate_arguments (void)
 {
@@ -291,9 +289,6 @@
 }
 
 
-
-
-
 void
 print_help (void)
 {

Index: check_nagios.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_nagios.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- check_nagios.c	20 Dec 2004 22:20:57 -0000	1.24
+++ check_nagios.c	25 Dec 2004 23:17:44 -0000	1.25
@@ -95,7 +95,7 @@
 	fclose (fp);
 
 	if (verbose >= 2)
-		printf("command: %s\n", PS_COMMAND);
+		printf(_("command: %s\n"), PS_COMMAND);
 
 	/* run the command to check for the Nagios process.. */
 	child_process = spopen (PS_COMMAND);
@@ -206,8 +206,7 @@
 			expire_minutes = atoi (argv[2]);
 		else
 			die (STATE_UNKNOWN,
-								 _("Expiration time must be an integer (seconds)\nType '%s -h' for additional help\n"),
-								 progname);
+								 _("Expiration time must be an integer (seconds)\n"));
 		process_string = argv[3];
 		return OK;
 	}
@@ -220,9 +219,7 @@
 
 		switch (c) {
 		case '?':									/* print short usage statement if args not parsable */
-			printf (_("%s: Unknown argument: %c\n\n"), progname, optopt);
-			print_usage ();
-			exit (STATE_UNKNOWN);
+			usage2 (_("Unknown argument"), optarg);
 		case 'h':									/* help */
 			print_help ();
 			exit (STATE_OK);
@@ -240,8 +237,7 @@
 				expire_minutes = atoi (optarg);
 			else
 				die (STATE_UNKNOWN,
-				     _("Expiration time must be an integer (seconds)\nType '%s -h' for additional help\n"),
-				     progname);
+				     _("Expiration time must be an integer (seconds)\n"));
 			break;
 		case 'v':
 			verbose++;
@@ -252,12 +248,10 @@
 
 	if (status_log == NULL)
 		die (STATE_UNKNOWN,
-		     _("You must provide the status_log\nType '%s -h' for additional help\n"),
-		     progname);
+		     _("You must provide the status_log\n"));
 	else if (process_string == NULL)
 		die (STATE_UNKNOWN,
-							 _("You must provide a process string\nType '%s -h' for additional help\n"),
-							 progname);
+							 _("You must provide a process string\n"));
 
 	return OK;
 }

Index: check_procs.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_procs.c,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- check_procs.c	10 Dec 2004 00:20:23 -0000	1.41
+++ check_procs.c	25 Dec 2004 23:17:44 -0000	1.42
@@ -343,9 +343,7 @@
 
 		switch (c) {
 		case '?':									/* help */
-			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);
@@ -368,7 +366,7 @@
 			else if (sscanf (optarg, "%d:", &cmin) == 1)
 				break;
 			else
-				usage (_("Critical Process Count must be an integer!\n\n"));
+				usage4 (_("Critical Process Count must be an integer!"));
 			break;							 
 		case 'w':									/* warning threshold */
 			if (is_integer (optarg))
@@ -380,7 +378,7 @@
 			else if (sscanf (optarg, "%d:", &wmin) == 1)
 				break;
 			else
-				usage (_("Warning Process Count must be an integer!\n\n"));
+				usage4 (_("Warning Process Count must be an integer!"));
 			break;
 		case 'p':									/* process id */
 			if (sscanf (optarg, "%d%[^0-9]", &ppid, tmp) == 1) {
@@ -388,7 +386,7 @@
 				options |= PPID;
 				break;
 			}
-			usage2 (_("%s: Parent Process ID must be an integer!\n\n"),  progname);
+			usage4 (_("Parent Process ID must be an integer!"));
 		case 's':									/* status */
 			if (statopts)
 				break;
@@ -403,13 +401,13 @@
 				pw = getpwuid ((uid_t) uid);
 				/*  check to be sure user exists */
 				if (pw == NULL)
-					usage2 (_("UID %s was not found\n"), optarg);
+					usage2 (_("UID %s was not found"), optarg);
 			}
 			else {
 				pw = getpwnam (optarg);
 				/*  check to be sure user exists */
 				if (pw == NULL)
-					usage2 (_("User name %s was not found\n"), optarg);
+					usage2 (_("User name %s was not found"), optarg);
 				/*  then get uid */
 				uid = pw->pw_uid;
 			}
@@ -443,14 +441,14 @@
 				options |= RSS;
 				break;
 			}
-			usage2 (_("%s: RSS must be an integer!\n\n"), progname);
+			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);
 				options |= VSZ;
 				break;
 			}
-			usage2 (_("%s: VSZ must be an integer!\n\n"), progname);
+			usage4 (_("VSZ must be an integer!"));
 		case 'P':					/* PCPU */
 			/* TODO: -P 1.5.5 is accepted */
 			if (sscanf (optarg, "%f%[^0-9.]", &pcpu, tmp) == 1) {
@@ -458,7 +456,7 @@
 				options |= PCPU;
 				break;
 			}
-			usage2 (_("%s: PCPU must be a float!\n\n"), progname);
+			usage4 (_("PCPU must be a float!"));
 		case 'm':
 			asprintf (&metric_name, "%s", optarg);
 			if ( strcmp(optarg, "PROCS") == 0) {
@@ -482,10 +480,7 @@
 				break;
 			}
 				
-			printf (_("%s: metric must be one of PROCS, VSZ, RSS, CPU, ELAPSED!\n\n"),
-				progname);
-			print_usage ();
-			exit (STATE_UNKNOWN);
+			usage4 (_("Metric must be one of PROCS, VSZ, RSS, CPU, ELAPSED!"));
 		case 'v':									/* command */
 			verbose++;
 			break;
@@ -588,8 +583,6 @@
 }
 
 
-
-
 /* convert the elapsed time to seconds */
 int
 convert_to_seconds(char *etime) {
@@ -653,7 +646,6 @@
 }
 
 
-
 void
 print_help (void)
 {

Index: negate.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/negate.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- negate.c	3 Dec 2004 23:55:29 -0000	1.23
+++ negate.c	25 Dec 2004 23:17:44 -0000	1.24
@@ -174,9 +174,7 @@
 
 		switch (c) {
 		case '?':     /* help */
-			printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
-			print_usage ();
-			exit (STATE_UNKNOWN);
+			usage2 (_("Unknown argument"), optarg);
 			break;
 		case 'h':     /* help */
 			print_help ();

Index: check_nt.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_nt.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- check_nt.c	22 Dec 2004 23:02:10 -0000	1.37
+++ check_nt.c	25 Dec 2004 23:17:44 -0000	1.38
@@ -423,7 +423,7 @@
 
 	case CHECK_NONE:
 	default:
-		usage (_("Please specify a variable to check"));
+		usage4 (_("Please specify a variable to check"));
 		break;
 
 	}
@@ -487,14 +487,12 @@
 		switch (c)
 			{
 			case '?': /* print short usage statement if args not parsable */
-				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);
 			case 'V': /* version */
-				print_revision(progname,"$Revision$");
+				print_revision(progname,revision);
 				exit(STATE_OK);
 			case 'H': /* hostname */
 				if (server_address)	free(server_address);
@@ -507,7 +505,7 @@
 				if (is_intnonneg(optarg))
 					server_port=atoi(optarg);
 				else
-					die(STATE_UNKNOWN,_("Server port an integer (seconds)\nType '%s -h' for additional help\n"),progname);
+					die(STATE_UNKNOWN,_("Server port must be an integer\n"));
 				break;
 			case 'v':
 				if(strlen(optarg)<4)
@@ -573,7 +571,7 @@
 	result=process_tcp_request(address, port, sendb, recv_buffer,sizeof(recv_buffer));
 
 	if(result!=STATE_OK)
-		die (result, "could not fetch information from server\n");
+		die (result, _("could not fetch information from server\n"));
 		
 	if (!strncmp(recv_buffer,"ERROR",5))
 		die (STATE_UNKNOWN, "NSClient - %s\n",recv_buffer);

Index: utils.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/utils.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- utils.c	3 Dec 2004 19:20:35 -0000	1.40
+++ utils.c	25 Dec 2004 23:17:44 -0000	1.41
@@ -53,7 +53,7 @@
 
 void usage (const char *msg)
 {
-	printf ("%s", msg);
+	printf ("%s\n", msg);
 	print_usage ();
 	exit (STATE_UNKNOWN);
 }
@@ -133,7 +133,7 @@
 timeout_alarm_handler (int signo)
 {
 	if (signo == SIGALRM) {
-		printf ("CRITICAL - Plugin timed out after %d seconds\n",
+		printf (_("CRITICAL - Plugin timed out after %d seconds\n"),
 						timeout_interval);
 		exit (STATE_CRITICAL);
 	}
@@ -430,7 +430,7 @@
 	if (dest == NULL || strlen (dest) < len)
 		dest = realloc (dest, len + 1);
 	if (dest == NULL)
-		die (STATE_UNKNOWN, "failed realloc in strpcpy\n");
+		die (STATE_UNKNOWN, _("failed realloc in strpcpy\n"));
 
 	strncpy (dest, src, len);
 	dest[len] = '\0';
@@ -472,7 +472,7 @@
 
 	dest = realloc (dest, len + l2 + 1);
 	if (dest == NULL)
-		die (STATE_UNKNOWN, "failed malloc in strscat\n");
+		die (STATE_UNKNOWN, _("failed malloc in strscat\n"));
 
 	strncpy (dest + len, src, l2);
 	dest[len + l2] = '\0';

Index: check_load.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_load.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- check_load.c	3 Dec 2004 23:55:28 -0000	1.26
+++ check_load.c	25 Dec 2004 23:17:44 -0000	1.27
@@ -224,9 +224,7 @@
 			print_help ();
 			exit (STATE_OK);
 		case '?':									/* help */
-			printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
-			print_usage ();
-			exit (STATE_UNKNOWN);
+			usage2 (_("Unknown argument"), optarg);
 		}
 	}
 

Index: urlize.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/urlize.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- urlize.c	3 Dec 2004 20:28:53 -0000	1.16
+++ urlize.c	25 Dec 2004 23:17:44 -0000	1.17
@@ -71,9 +71,7 @@
 			break;
 		case '?':
 		default:
-			printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
-			print_usage ();
-			exit (STATE_UNKNOWN);
+			usage2 (_("Unknown argument"), optarg);
 		}
 	}
 





More information about the Commits mailing list