[Nagiosplug-checkins] CVS: nagiosplug/plugins check_ssh.c,1.9,1.10

Karl DeBisschop kdebisschop at users.sourceforge.net
Tue Aug 5 04:54:02 CEST 2003


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

Modified Files:
	check_ssh.c 
Log Message:
markup for translation

Index: check_ssh.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_ssh.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** check_ssh.c	30 Jun 2003 18:52:38 -0000	1.9
--- check_ssh.c	5 Aug 2003 11:53:21 -0000	1.10
***************
*** 1,15 ****
! /*
! * check_ssh.c
! * 
! * Made by (Remi PAULMIER)
! * Login   <remi at sinfomic.fr>
! * 
! * Started on  Fri Jul  9 09:18:23 1999 Remi PAULMIER
! * Update Thu Jul 22 12:50:04 1999 remi paulmier
! * $Id$
! *
! */
  
- #include "config.h"
  #include "common.h"
  #include "netutils.h"
--- 1,20 ----
! /******************************************************************************
! 
!  This program is free software; you can redistribute it and/or modify
!  it under the terms of the GNU General Public License as published by
!  the Free Software Foundation; either version 2 of the License, or
!  (at your option) any later version.
! 
!  This program is distributed in the hope that it will be useful,
!  but WITHOUT ANY WARRANTY; without even the implied warranty of
!  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
!  GNU General Public License for more details.
! 
!  You should have received a copy of the GNU General Public License
!  along with this program; if not, write to the Free Software
!  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
! 
! ******************************************************************************/
  
  #include "common.h"
  #include "netutils.h"
***************
*** 17,21 ****
  
  const char *progname = "check_ssh";
! #define REVISION "$Revision$"
  
  #ifndef MSG_DONTWAIT
--- 22,28 ----
  
  const char *progname = "check_ssh";
! const char *revision = "$Revision$";
! const char *copyright = "2000-2003";
! const char *email = "nagiosplug-devel at lists.sourceforge.net";
  
  #ifndef MSG_DONTWAIT
***************
*** 43,47 ****
  
  	if (process_arguments (argc, argv) == ERROR)
! 		usage ("Could not parse arguments\n");
  
  	/* initialize alarm signal handling */
--- 50,54 ----
  
  	if (process_arguments (argc, argv) == ERROR)
! 		usage (_("Could not parse arguments\n"));
  
  	/* initialize alarm signal handling */
***************
*** 63,77 ****
  {
  	int c;
- 	char *tmp = NULL;
  
  	int option_index = 0;
  	static struct option long_options[] = {
- 		{"version", no_argument, 0, 'V'},
  		{"help", no_argument, 0, 'h'},
  		{"use-ipv4", no_argument, 0, '4'},
  		{"use-ipv6", no_argument, 0, '6'},
- 		{"verbose", no_argument, 0, 'v'},
  		{"timeout", required_argument, 0, 't'},
! 		{"host", required_argument, 0, 'H'},
  		{0, 0, 0, 0}
  	};
--- 70,84 ----
  {
  	int c;
  
  	int option_index = 0;
  	static struct option long_options[] = {
  		{"help", no_argument, 0, 'h'},
+ 		{"version", no_argument, 0, 'V'},
+ 		{"host", required_argument, 0, 'H'},
+ 		{"port", required_argument, 0, 'p'},
  		{"use-ipv4", no_argument, 0, '4'},
  		{"use-ipv6", no_argument, 0, '6'},
  		{"timeout", required_argument, 0, 't'},
! 		{"verbose", no_argument, 0, 'v'},
  		{0, 0, 0, 0}
  	};
***************
*** 94,98 ****
  			usage ("");
  		case 'V':									/* version */
! 			print_revision (progname, REVISION);
  			exit (STATE_OK);
  		case 'h':									/* help */
--- 101,105 ----
  			usage ("");
  		case 'V':									/* version */
! 			print_revision (progname, revision);
  			exit (STATE_OK);
  		case 'h':									/* help */
***************
*** 104,108 ****
  		case 't':									/* timeout period */
  			if (!is_integer (optarg))
! 				usage ("Timeout Interval must be an integer!\n\n");
  			socket_timeout = atoi (optarg);
  			break;
--- 111,115 ----
  		case 't':									/* timeout period */
  			if (!is_integer (optarg))
! 				usage (_("Timeout Interval must be an integer!\n\n"));
  			socket_timeout = atoi (optarg);
  			break;
***************
*** 114,118 ****
  			address_family = AF_INET6;
  #else
! 			usage ("IPv6 support not available\n");
  #endif
  			break;
--- 121,125 ----
  			address_family = AF_INET6;
  #else
! 			usage (_("IPv6 support not available\n"));
  #endif
  			break;
***************
*** 180,186 ****
  	char *ssh_proto = NULL;
  	char *ssh_server = NULL;
! 	char revision[20];
  
! 	sscanf ("$Revision$", "$Revision: %[0123456789.]", revision);
  
  	result = my_tcp_connect (haddr, hport, &sd);
--- 187,193 ----
  	char *ssh_proto = NULL;
  	char *ssh_server = NULL;
! 	char rev_no[20];
  
! 	sscanf ("$Revision$", "$Revision: %[0123456789.]", rev_no);
  
  	result = my_tcp_connect (haddr, hport, &sd);
***************
*** 193,197 ****
  	recv (sd, output, BUFF_SZ, 0);
  	if (strncmp (output, "SSH", 3)) {
! 		printf ("Server answer: %s", output);
  		exit (STATE_CRITICAL);
  	}
--- 200,204 ----
  	recv (sd, output, BUFF_SZ, 0);
  	if (strncmp (output, "SSH", 3)) {
! 		printf (_("Server answer: %s"), output);
  		exit (STATE_CRITICAL);
  	}
***************
*** 204,210 ****
  		ssh_proto[strspn (ssh_proto, "0123456789. ")] = 0;
  		printf
! 			("SSH OK - %s (protocol %s)\n",
  			 ssh_server, ssh_proto);
! 		asprintf (&buffer, "SSH-%s-check_ssh_%s\r\n", ssh_proto, revision);
  		send (sd, buffer, strlen (buffer), MSG_DONTWAIT);
  		if (verbose)
--- 211,217 ----
  		ssh_proto[strspn (ssh_proto, "0123456789. ")] = 0;
  		printf
! 			(_("SSH OK - %s (protocol %s)\n"),
  			 ssh_server, ssh_proto);
! 		asprintf (&buffer, "SSH-%s-check_ssh_%s\r\n", ssh_proto, rev_no);
  		send (sd, buffer, strlen (buffer), MSG_DONTWAIT);
  		if (verbose)
***************
*** 217,224 ****
  print_help (void)
  {
! 	print_revision (progname, REVISION);
! 	printf ("Copyright (c) 1999 Remi Paulmier (remi at sinfomic.fr)\n\n");
  	print_usage ();
! 	printf ("by default, port is %d\n", SSH_DFL_PORT);
  }
  
--- 224,250 ----
  print_help (void)
  {
! 	char *myport;
! 	asprintf (&myport, "%d", SSH_DFL_PORT);
! 
! 	print_revision (progname, revision);
! 
! 	printf (_("Copyright (c) 1999 Remi Paulmier <remi at sinfomic.fr>\n"));
! 	printf (_(COPYRIGHT), copyright, email);
! 
! 	printf (_("Try to connect to SSH server at specified server and port\n\n"));
! 
  	print_usage ();
! 
! 	printf (_(UT_HELP_VRSN));
! 
! 	printf (_(UT_HOST_PORT), 'p', myport);
! 
! 	printf (_(UT_IPv46));
! 
! 	printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT);
! 
! 	printf (_(UT_VERBOSE));
! 
! 	printf (_(UT_SUPPORT));
  }
  
***************
*** 226,237 ****
  print_usage (void)
  {
! 	printf
! 		("Usage:\n"
! 		 " %s -t [timeout] -p [port] <host>\n"
! 		 " %s -V prints version info\n"
! 		 " %s -4 use IPv4 connection\n"
! 		 " %s -6 use IPv6 connection\n"
! 		 " %s -h prints more detailed help\n", 
! 		 progname, progname, progname, progname, progname);
  }
  
--- 252,258 ----
  print_usage (void)
  {
! 	printf (_("\
! Usage: %s [-46] [-t <timeout>] [-p <port>] <host>\n"), progname);
! 	printf (_(UT_HLP_VRS), progname, progname);
  }
  





More information about the Commits mailing list