[Nagiosplug-checkins] CVS: nagiosplug/plugins Makefile.am,1.29,1.30 check_tcp.c,1.26,1.27 common.h,1.5,1.6 utils.c,1.23,1.24

Karl DeBisschop kdebisschop at users.sourceforge.net
Sat Jul 26 13:12:01 CEST 2003


Update of /cvsroot/nagiosplug/nagiosplug/plugins
In directory sc8-pr-cvs1:/tmp/cvs-serv31307/plugins

Modified Files:
	Makefile.am check_tcp.c common.h utils.c 
Log Message:
checkins for internationalization

Index: Makefile.am
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/Makefile.am,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -r1.29 -r1.30
*** Makefile.am	4 Jul 2003 10:42:13 -0000	1.29
--- Makefile.am	26 Jul 2003 04:06:33 -0000	1.30
***************
*** 3,7 ****
  VPATH = $(top_srcdir) $(top_srcdir)/lib $(top_srcdir)/plugins $(top_srcdir)/plugins/t 
  
! INCLUDES = -I.. -I$(top_srcdir)/lib @LDAPINCLUDE@ @PGINCLUDE@ @SSLINCLUDE@ 
  
  libexec_PROGRAMS = check_disk check_dummy check_http check_load \
--- 3,13 ----
  VPATH = $(top_srcdir) $(top_srcdir)/lib $(top_srcdir)/plugins $(top_srcdir)/plugins/t 
  
! INCLUDES = -I.. -I$(top_srcdir)/lib -I$(top_srcdir)/intl \
! @LDAPINCLUDE@ @PGINCLUDE@ @SSLINCLUDE@ 
! 
! datadir = @datadir@
! localedir = $(datadir)/locale
! DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
! LIBS = @LIBINTL@ @LIBS@
  
  libexec_PROGRAMS = check_disk check_dummy check_http check_load \

Index: check_tcp.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_tcp.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -r1.26 -r1.27
*** check_tcp.c	30 Jun 2003 18:52:38 -0000	1.26
--- check_tcp.c	26 Jul 2003 04:06:33 -0000	1.27
***************
*** 16,72 ****
  *
  *****************************************************************************/
- 
- /* progname changes depending on symlink called */
- char *progname = "check_tcp";
- const char *revision = "$Revision$";
- const char *copyright = "2002-2003";
- const char *authors = "Nagios Plugin Development Team";
- const char *email = "nagiosplug-devel at lists.sourceforge.net";
- 
- const char *summary = "\
- This plugin tests %s connections with the specified host.\n";
- 
- const char *option_summary = "\
- -H host -p port [-w warn_time] [-c crit_time] [-s send_string]\n\
- 	[-e expect_string] [-q quit_string] [-m maxbytes] [-d delay]\n\
- 	[-t to_sec] [-r refuse_state] [-v] [-4|-6]\n";
- 
- const char *options = "\
-  -H, --hostname=ADDRESS\n\
-     Host name argument for servers using host headers (use numeric\n\
-     address if possible to bypass DNS lookup).\n\
-  -p, --port=INTEGER\n\
-     Port number\n\
-  -4, --use-ipv4\n\
-     Use IPv4 connection\n\
-  -6, --use-ipv6\n\
-     Use IPv6 connection\n\
-  -s, --send=STRING\n\
-     String to send to the server\n\
-  -e, --expect=STRING\n\
-     String to expect in server response\n\
-  -q, --quit=STRING\n\
-     String to send server to initiate a clean close of the connection\n\
-  -m, --maxbytes=INTEGER\n\
-     Close connection once more than this number of bytes are received\n\
-  -d, --delay=INTEGER\n\
-     Seconds to wait between sending string and polling for response\n\
-  -w, --warning=DOUBLE\n\
-     Response time to result in warning status (seconds)\n\
-  -c, --critical=DOUBLE\n\
-     Response time to result in critical status (seconds)\n\
-  -t, --timeout=INTEGER\n\
-     Seconds before connection times out (default: %d)\n\
-  -r, --refuse=ok|warn|crit\n\
-     Accept tcp refusals with states ok, warn, crit (default: crit)\n\
-  -v, --verbose\n\
-     Show details for command-line debugging (Nagios may truncate output)\n";
- 
- const char *standard_options = "\
-  -h, --help\n\
-     Print detailed help screen\n\
-  -V, --version\n\
-     Print version information\n\n";
- 
  #include "config.h"
  #include "common.h"
--- 16,19 ----
***************
*** 138,141 ****
--- 85,95 ----
  char *buffer = "";
  
+ /* progname changes depending on symlink called */
+ char *progname = "check_tcp";
+ const char *revision = "$Revision$";
+ const char *copyright = "2002-2003";
+ const char *authors = "Nagios Plugin Development Team";
+ const char *email = "nagiosplug-devel at lists.sourceforge.net";
+ 
  int
  main (int argc, char **argv)
***************
*** 146,149 ****
--- 100,107 ----
  	struct timeval tv;
  
+ 	setlocale (LC_ALL, "");
+ 	bindtextdomain (PACKAGE, LOCALEDIR);
+ 	textdomain (PACKAGE);
+ 
  	if (strstr (argv[0], "check_udp")) {
  		progname = strdup ("check_udp");
***************
*** 302,306 ****
  			if (buffer[i-2] == '\r' && buffer[i-1] == '\n')
  				break;
! 			if (maxbytes>0 && strlen(status)>=maxbytes)
  				break;
  		}
--- 260,264 ----
  			if (buffer[i-2] == '\r' && buffer[i-1] == '\n')
  				break;
! 			if (maxbytes>0 && strlen(status) >= (unsigned)maxbytes)
  				break;
  		}
***************
*** 548,557 ****
  {
  	print_revision (progname, revision);
  	printf ("Copyright (c) %s %s\n\t<%s>\n\n", copyright, authors, email);
! 	printf (summary, SERVICE);
  	print_usage ();
  	printf ("\nOptions:\n");
! 	printf (options, DEFAULT_SOCKET_TIMEOUT);
! 	printf (standard_options);
  	support ();
  }
--- 506,561 ----
  {
  	print_revision (progname, revision);
+ 
  	printf ("Copyright (c) %s %s\n\t<%s>\n\n", copyright, authors, email);
! 
! 	printf (_("\
! This plugin tests %s connections with the specified host.\n"), SERVICE);
! 
  	print_usage ();
+ 
  	printf ("\nOptions:\n");
! 
! 	printf (_("\
!  -H, --hostname=ADDRESS\n\
!     Host name argument for servers using host headers (use numeric\n\
!     address if possible to bypass DNS lookup).\n\
!  -p, --port=INTEGER\n\
!     Port number\n\
!  -4, --use-ipv4\n\
!     Use IPv4 connection\n\
!  -6, --use-ipv6\n\
!     Use IPv6 connection\n"));
! 
! 	printf (_("\
!  -s, --send=STRING\n\
!     String to send to the server\n\
!  -e, --expect=STRING\n\
!     String to expect in server response\n\
!  -q, --quit=STRING\n\
!     String to send server to initiate a clean close of the connection\n"));
! 
! 	printf (_("\
!  -r, --refuse=ok|warn|crit\n\
!     Accept tcp refusals with states ok, warn, crit (default: crit)\n\
!  -m, --maxbytes=INTEGER\n\
!     Close connection once more than this number of bytes are received\n\
!  -d, --delay=INTEGER\n\
!     Seconds to wait between sending string and polling for response\n\
!  -w, --warning=DOUBLE\n\
!     Response time to result in warning status (seconds)\n\
!  -c, --critical=DOUBLE\n\
!     Response time to result in critical status (seconds)\n"));
! 
! 	printf (_("\
!  -t, --timeout=INTEGER\n\
!     Seconds before connection times out (default: %d)\n\
!  -v, --verbose\n\
!     Show details for command-line debugging (Nagios may truncate output)\n\
!  -h, --help\n\
!     Print detailed help screen\n\
!  -V, --version\n\
!     Print version information\n\n"),
! 					DEFAULT_SOCKET_TIMEOUT);
! 
  	support ();
  }
***************
*** 560,564 ****
  print_usage (void)
  {
! 	printf ("Usage: %s %s\n", progname, option_summary);
  	printf ("       %s (-h|--help)\n", progname);
  	printf ("       %s (-V|--version)\n", progname);
--- 564,571 ----
  print_usage (void)
  {
! 	printf ("Usage: %s %s\n", progname, _("\
! -H host -p port [-w warn_time] [-c crit_time] [-s send_string]\n\
! 	[-e expect_string] [-q quit_string] [-m maxbytes] [-d delay]\n\
! 	[-t to_sec] [-r refuse_state] [-v] [-4|-6]\n"));
  	printf ("       %s (-h|--help)\n", progname);
  	printf ("       %s (-V|--version)\n", progname);

Index: common.h
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/common.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** common.h	21 Jul 2003 12:06:24 -0000	1.5
--- common.h	26 Jul 2003 04:06:33 -0000	1.6
***************
*** 157,162 ****
   */
  
! #define _(String) (String)
! #define N_(String) String
! #define textdomain(Domain)
! #define bindtextdomain(Package, Directory)
--- 157,169 ----
   */
  
! #if ENABLE_NLS
! #  include "gettext.h"
! #  define _(String) gettext (String)
! #  define gettext_noop(String) String
! #  define N_(String) gettext_noop String
! #else
! #  define _(String) (String)
! #  define N_(String) String
! #  define textdomain(Domain)
! #  define bindtextdomain(Package, Directory)
! #endif

Index: utils.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/utils.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -r1.23 -r1.24
*** utils.c	3 Jul 2003 03:19:11 -0000	1.23
--- utils.c	26 Jul 2003 04:06:33 -0000	1.24
***************
*** 134,139 ****
  	if (sscanf (revision_string, "$Revision: %[0-9.]", plugin_revision) != 1)
  		strncpy (plugin_revision, "N/A", STRLEN);
! 	printf ("%s (nagios-plugins %s) %s\n",
! 					progname, VERSION, plugin_revision);
  	printf
  		("The nagios plugins come with ABSOLUTELY NO WARRANTY. You may redistribute\n"
--- 134,139 ----
  	if (sscanf (revision_string, "$Revision: %[0-9.]", plugin_revision) != 1)
  		strncpy (plugin_revision, "N/A", STRLEN);
! 	printf ("%s (%s %s) %s\n",
! 					progname, PACKAGE, VERSION, plugin_revision);
  	printf
  		("The nagios plugins come with ABSOLUTELY NO WARRANTY. You may redistribute\n"





More information about the Commits mailing list