[Nagiosplug-checkins] CVS: nagiosplug/plugins check_by_ssh.c,1.6,1.7 check_dig.c,1.7,1.8 check_disk.c,1.6,1.7 check_dns.c,1.5,1.6 check_dummy.c,1.1.1.1,1.2 check_fping.c,1.3,1.4 check_hpjd.c,1.5,1.6 check_http.c,1.13,1.14 check_ldap.c,1.2,1.3 check_load.c,1.4,1.5 check_mrtg.c,1.3,1.4 check_mrtgtraf.c,1.2,1.3 check_mysql.c,1.2,1.3 check_nagios.c,1.3,1.4 check_nwstat.c,1.3,1.4 check_overcr.c,1.1.1.1,1.2 check_pgsql.c,1.3,1.4 check_ping.c,1.10,1.11 check_procs.c,1.5,1.6 check_radius.c,1.2,1.3 check_real.c,1.2,1.3 check_smtp.c,1.8,1.9 check_snmp.c,1.20,1.21 check_ssh.c,1.3,1.4 check_swap.c,1.6,1.7 check_tcp.c,1.10,1.11 check_time.c,1.3,1.4 check_udp.c,1.2,1.3 check_ups.c,1.5,1.6 check_users.c,1.2,1.3 check_vsz.c,1.4,1.5 negate.c,1.3,1.4 urlize.c,1.4,1.5 utils.c,1.14,1.15 utils.h.in,1.7,1.8

Karl DeBisschop kdebisschop at users.sourceforge.net
Mon Jan 13 04:16:02 CET 2003


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

Modified Files:
	check_by_ssh.c check_dig.c check_disk.c check_dns.c 
	check_dummy.c check_fping.c check_hpjd.c check_http.c 
	check_ldap.c check_load.c check_mrtg.c check_mrtgtraf.c 
	check_mysql.c check_nagios.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 check_vsz.c negate.c urlize.c utils.c utils.h.in 
Log Message:
convert PROGANE from a define to a const char

Index: check_by_ssh.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_by_ssh.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** check_by_ssh.c	20 Nov 2002 01:19:07 -0000	1.6
--- check_by_ssh.c	13 Jan 2003 12:15:15 -0000	1.7
***************
*** 23,27 ****
   *****************************************************************************/
   
! #define PROGRAM check_by_ssh
  #define DESCRIPTION "Run checks on a remote system using ssh, wrapping the proper timeout around the ssh invocation."
  #define AUTHOR "Karl DeBisschop"
--- 23,27 ----
   *****************************************************************************/
   
! const char *progname = "check_by_ssh";
  #define DESCRIPTION "Run checks on a remote system using ssh, wrapping the proper timeout around the ssh invocation."
  #define AUTHOR "Karl DeBisschop"
***************
*** 35,43 ****
  #include <time.h>
  
- #define PROGNAME "check_by_ssh"
- 
  int process_arguments (int, char **);
  int validate_arguments (void);
! void print_help (char *command_name);
  void print_usage (void);
  
--- 35,41 ----
  #include <time.h>
  
  int process_arguments (int, char **);
  int validate_arguments (void);
! void print_help (const char *command_name);
  void print_usage (void);
  
***************
*** 224,231 ****
  			exit (STATE_UNKNOWN);
  		case 'V':									/* version */
! 			print_revision (PROGNAME, "$Revision$");
  			exit (STATE_OK);
  		case 'h':									/* help */
! 			print_help (PROGNAME);
  			exit (STATE_OK);
  		case 'v':									/* help */
--- 222,229 ----
  			exit (STATE_UNKNOWN);
  		case 'V':									/* version */
! 			print_revision (progname, "$Revision$");
  			exit (STATE_OK);
  		case 'h':									/* help */
! 			print_help (progname);
  			exit (STATE_OK);
  		case 'v':									/* help */
***************
*** 287,291 ****
  	if (hostname == NULL) {
  		if (!is_host (argv[c]))
! 			terminate (STATE_UNKNOWN, "%s: Invalid host name %s\n", PROGNAME, argv[c]);
  		hostname = argv[c++];
  	}
--- 285,289 ----
  	if (hostname == NULL) {
  		if (!is_host (argv[c]))
! 			terminate (STATE_UNKNOWN, "%s: Invalid host name %s\n", progname, argv[c]);
  		hostname = argv[c++];
  	}
***************
*** 318,325 ****
  
  	if (passive && commands != services)
! 		terminate (STATE_UNKNOWN, "%s: In passive mode, you must provide a service name for each command.\n", PROGNAME);
  
  	if (passive && host_shortname == NULL)
! 		terminate (STATE_UNKNOWN, "%s: In passive mode, you must provide the host short name from the nagios configs.\n", PROGNAME);
  
  	return OK;
--- 316,323 ----
  
  	if (passive && commands != services)
! 		terminate (STATE_UNKNOWN, "%s: In passive mode, you must provide a service name for each command.\n", progname);
  
  	if (passive && host_shortname == NULL)
! 		terminate (STATE_UNKNOWN, "%s: In passive mode, you must provide the host short name from the nagios configs.\n", progname);
  
  	return OK;
***************
*** 331,335 ****
  
  void
! print_help (char *cmd)
  {
  	print_revision (cmd, "$Revision$");
--- 329,333 ----
  
  void
! print_help (const char *cmd)
  {
  	print_revision (cmd, "$Revision$");

Index: check_dig.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_dig.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** check_dig.c	21 Nov 2002 12:40:58 -0000	1.7
--- check_dig.c	13 Jan 2003 12:15:15 -0000	1.8
***************
*** 26,30 ****
  #include "popen.h"
  
! #define PROGNAME "check_dig"
  #define REVISION "$Revision$"
  #define COPYRIGHT "2000-2002"
--- 26,30 ----
  #include "popen.h"
  
! const char *progname = "check_dig";
  #define REVISION "$Revision$"
  #define COPYRIGHT "2000-2002"
***************
*** 198,202 ****
  			break;
  		case 'V':									/* version */
! 			print_revision (PROGNAME, "$Revision$");
  			exit (STATE_OK);
  		case 'h':									/* help */
--- 198,202 ----
  			break;
  		case 'V':									/* version */
! 			print_revision (progname, "$Revision$");
  			exit (STATE_OK);
  		case 'h':									/* help */
***************
*** 241,245 ****
  print_help (void)
  {
! 	print_revision (PROGNAME, "$Revision$");
  	printf
  		("Copyright (c) %s %s <%s>\n\n%s\n",
--- 241,245 ----
  print_help (void)
  {
! 	print_revision (progname, "$Revision$");
  	printf
  		("Copyright (c) %s %s <%s>\n\n%s\n",
***************
*** 273,276 ****
  		("Usage: %s -H host -l lookup [-t timeout] [-v]\n"
  		 "       %s --help\n"
! 		 "       %s --version\n", PROGNAME, PROGNAME, PROGNAME);
  }
--- 273,276 ----
  		("Usage: %s -H host -l lookup [-t timeout] [-v]\n"
  		 "       %s --help\n"
! 		 "       %s --version\n", progname, progname, progname);
  }

Index: check_disk.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_disk.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** check_disk.c	13 Jan 2003 04:50:03 -0000	1.6
--- check_disk.c	13 Jan 2003 12:15:15 -0000	1.7
***************
*** 46,50 ****
  void print_usage (void);
  
! const char *PROGNAME = "check_disk";
  
  int w_df = -1;
--- 46,50 ----
  void print_usage (void);
  
! const char *progname = "check_disk";
  
  int w_df = -1;
***************
*** 253,257 ****
   			break;
  		case 'V':									/* version */
! 			print_revision (PROGNAME, REVISION);
  			exit (STATE_OK);
  		case 'h':									/* help */
--- 253,257 ----
   			break;
  		case 'V':									/* version */
! 			print_revision (progname, REVISION);
  			exit (STATE_OK);
  		case 'h':									/* help */
***************
*** 324,328 ****
  print_help (void)
  {
! 	print_revision (PROGNAME, REVISION);
  	printf
  		("Copyright (c) 2000 Ethan Galstad/Karl DeBisschop\n\n"
--- 324,328 ----
  print_help (void)
  {
! 	print_revision (progname, REVISION);
  	printf
  		("Copyright (c) 2000 Ethan Galstad/Karl DeBisschop\n\n"
***************
*** 363,366 ****
  		("Usage: %s -w limit -c limit [-p path | -x device] [-t timeout] [-m] [-e] [--verbose]\n"
  		 "       %s (-h|--help)\n"
! 		 "       %s (-V|--version)\n", PROGNAME, PROGNAME, PROGNAME);
  }
--- 363,366 ----
  		("Usage: %s -w limit -c limit [-p path | -x device] [-t timeout] [-m] [-e] [--verbose]\n"
  		 "       %s (-h|--help)\n"
! 		 "       %s (-V|--version)\n", progname, progname, progname);
  }

Index: check_dns.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_dns.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** check_dns.c	14 Nov 2002 02:26:34 -0000	1.5
--- check_dns.c	13 Jan 2003 12:15:15 -0000	1.6
***************
*** 49,53 ****
  #include "utils.h"
  
! #define PROGNAME "check_dns"
  #define REVISION "$Revision$"
  #define COPYRIGHT "2000-2002"
--- 49,53 ----
  #include "utils.h"
  
! const char *progname = "check_dns";
  #define REVISION "$Revision$"
  #define COPYRIGHT "2000-2002"
***************
*** 293,297 ****
  		switch (c) {
  		case '?': /* args not parsable */
! 			printf ("%s: Unknown argument: %s\n\n", PROGNAME, optarg);
  			print_usage ();
  			exit (STATE_UNKNOWN);
--- 293,297 ----
  		switch (c) {
  		case '?': /* args not parsable */
! 			printf ("%s: Unknown argument: %s\n\n", progname, optarg);
  			print_usage ();
  			exit (STATE_UNKNOWN);
***************
*** 300,304 ****
  			exit (STATE_OK);
  		case 'V': /* version */
! 			print_revision (PROGNAME, REVISION);
  			exit (STATE_OK);
  		case 'v': /* version */
--- 300,304 ----
  			exit (STATE_OK);
  		case 'V': /* version */
! 			print_revision (progname, REVISION);
  			exit (STATE_OK);
  		case 'v': /* version */
***************
*** 389,393 ****
  {
  	printf ("Usage: %s -H host [-s server] [-a expected-address] [-t timeout]\n" "       %s --help\n"
! 					"       %s --version\n", PROGNAME, PROGNAME, PROGNAME);
  }
  
--- 389,393 ----
  {
  	printf ("Usage: %s -H host [-s server] [-a expected-address] [-t timeout]\n" "       %s --help\n"
! 					"       %s --version\n", progname, progname, progname);
  }
  
***************
*** 395,399 ****
  print_help (void)
  {
! 	print_revision (PROGNAME, REVISION);
  	printf ("Copyright (c) 1999 Ethan Galstad (nagios at nagios.org)\n\n");
  	print_usage ();
--- 395,399 ----
  print_help (void)
  {
! 	print_revision (progname, REVISION);
  	printf ("Copyright (c) 1999 Ethan Galstad (nagios at nagios.org)\n\n");
  	print_usage ();

Index: check_dummy.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_dummy.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** check_dummy.c	28 Feb 2002 06:42:57 -0000	1.1.1.1
--- check_dummy.c	13 Jan 2003 12:15:15 -0000	1.2
***************
*** 38,43 ****
  #include "utils.h"
  
! void print_help (char *);
! void print_usage (char *);
  
  int
--- 38,45 ----
  #include "utils.h"
  
! const char *progname = "check_dummy";
! 
! void print_help (const char *);
! void print_usage (const char *);
  
  int
***************
*** 83,87 ****
  
  void
! print_help (char *cmd)
  {
  	print_revision (cmd, "$Revision$");
--- 85,89 ----
  
  void
! print_help (const char *cmd)
  {
  	print_revision (cmd, "$Revision$");
***************
*** 95,99 ****
  
  void
! print_usage (char *cmd)
  {
  	printf ("Usage: %s <integer state>\n", cmd);
--- 97,101 ----
  
  void
! print_usage (const char *cmd)
  {
  	printf ("Usage: %s <integer state>\n", cmd);

Index: check_fping.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_fping.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** check_fping.c	13 Nov 2002 11:50:54 -0000	1.3
--- check_fping.c	13 Jan 2003 12:15:15 -0000	1.4
***************
*** 33,37 ****
  #include "utils.h"
  
! #define PROGNAME "check_fping"
  #define PACKET_COUNT 1
  #define PACKET_SIZE 56
--- 33,37 ----
  #include "utils.h"
  
! const char *progname = "check_fping";
  #define PACKET_COUNT 1
  #define PACKET_SIZE 56
***************
*** 244,248 ****
  		switch (c) {
  		case '?':									/* print short usage statement if args not parsable */
! 			printf ("%s: Unknown argument: %s\n\n", my_basename (argv[0]), optarg);
  			print_usage ();
  			exit (STATE_UNKNOWN);
--- 244,248 ----
  		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);
***************
*** 251,255 ****
  			exit (STATE_OK);
  		case 'V':									/* version */
! 			print_revision (my_basename (argv[0]), "$Revision$");
  			exit (STATE_OK);
  		case 'v':									/* verbose mode */
--- 251,255 ----
  			exit (STATE_OK);
  		case 'V':									/* version */
! 			print_revision (progname, "$Revision$");
  			exit (STATE_OK);
  		case 'v':									/* verbose mode */
***************
*** 326,335 ****
  		if (strstr (arg1, "%") && strstr (arg2, "%"))
  			terminate (STATE_UNKNOWN,
! 								 "%s: Only one threshold may be packet loss (%s)\n", PROGNAME,
  								 arg);
  		if (!strstr (arg1, "%") && !strstr (arg2, "%"))
  			terminate (STATE_UNKNOWN,
  								 "%s: Only one threshold must be packet loss (%s)\n",
! 								 PROGNAME, arg);
  	}
  
--- 326,335 ----
  		if (strstr (arg1, "%") && strstr (arg2, "%"))
  			terminate (STATE_UNKNOWN,
! 								 "%s: Only one threshold may be packet loss (%s)\n", progname,
  								 arg);
  		if (!strstr (arg1, "%") && !strstr (arg2, "%"))
  			terminate (STATE_UNKNOWN,
  								 "%s: Only one threshold must be packet loss (%s)\n",
! 								 progname, arg);
  	}
  
***************
*** 359,363 ****
  print_usage (void)
  {
! 	printf ("Usage: %s <host_address>\n", PROGNAME);
  }
  
--- 359,363 ----
  print_usage (void)
  {
! 	printf ("Usage: %s <host_address>\n", progname);
  }
  
***************
*** 370,374 ****
  {
  
! 	print_revision (PROGNAME, "$Revision$");
  
  	printf
--- 370,374 ----
  {
  
! 	print_revision (progname, "$Revision$");
  
  	printf

Index: check_hpjd.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_hpjd.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** check_hpjd.c	13 Nov 2002 11:50:54 -0000	1.5
--- check_hpjd.c	13 Jan 2003 12:15:15 -0000	1.6
***************
*** 66,70 ****
  #include "utils.h"
  
! #define PROGNAME "check_hpjd"
  #define REVISION "$Revision$"
  #define COPYRIGHT "2000-2002"
--- 66,70 ----
  #include "utils.h"
  
! const char *progname = "check_hpjd"
  #define REVISION "$Revision$"
  #define COPYRIGHT "2000-2002"
***************
*** 439,443 ****
  			break;
  		case 'V':									/* version */
! 			print_revision (PROGNAME, REVISION);
  			exit (STATE_OK);
  		case 'h':									/* help */
--- 439,443 ----
  			break;
  		case 'V':									/* version */
! 			print_revision (progname, REVISION);
  			exit (STATE_OK);
  		case 'h':									/* help */
***************
*** 483,487 ****
  print_help (void)
  {
! 	print_revision (PROGNAME, REVISION);
  	printf
  		("Copyright (c) 2000 Ethan Galstad/Karl DeBisschop\n\n"
--- 483,487 ----
  print_help (void)
  {
! 	print_revision (progname, REVISION);
  	printf
  		("Copyright (c) 2000 Ethan Galstad/Karl DeBisschop\n\n"
***************
*** 511,515 ****
  		("Usage: %s -H host [-C community]\n"
  		 "       %s --help\n"
! 		 "       %s --version\n", PROGNAME, PROGNAME, PROGNAME);
  }
  
--- 511,515 ----
  		("Usage: %s -H host [-C community]\n"
  		 "       %s --help\n"
! 		 "       %s --version\n", progname, progname, progname);
  }
  

Index: check_http.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_http.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -r1.13 -r1.14
*** check_http.c	19 Dec 2002 19:20:25 -0000	1.13
--- check_http.c	13 Jan 2003 12:15:16 -0000	1.14
***************
*** 24,28 ****
   *****************************************************************************/
  
! #define PROGNAME "check_http"
  #define REVISION "$Revision$"
  #define COPYRIGHT "1999-2001"
--- 24,28 ----
   *****************************************************************************/
  
! const char *progname = "check_http";
  #define REVISION "$Revision$"
  #define COPYRIGHT "1999-2001"
***************
*** 329,333 ****
  			break;
  		case 'V': /* version */
! 			print_revision (PROGNAME, REVISION);
  			exit (STATE_OK);
  			break;
--- 329,333 ----
  			break;
  		case 'V': /* version */
! 			print_revision (progname, REVISION);
  			exit (STATE_OK);
  			break;
***************
*** 1059,1063 ****
  print_help (void)
  {
! 	print_revision (PROGNAME, REVISION);
  	printf
  		("Copyright (c) %s %s <%s>\n\n%s\n",
--- 1059,1063 ----
  print_help (void)
  {
! 	print_revision (progname, REVISION);
  	printf
  		("Copyright (c) %s %s <%s>\n\n%s\n",
***************
*** 1084,1087 ****
  	        " %s -V for version information\n",
  #endif
! 	PROGNAME, OPTIONS, PROGNAME, PROGNAME);
  }
--- 1084,1087 ----
  	        " %s -V for version information\n",
  #endif
! 	progname, OPTIONS, progname, progname);
  }

Index: check_ldap.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_ldap.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** check_ldap.c	14 Nov 2002 02:26:34 -0000	1.2
--- check_ldap.c	13 Jan 2003 12:15:16 -0000	1.3
***************
*** 21,25 ****
   *****************************************************************************/
  
! #define PROGNAME "check_ldap"
  #define REVISION "$Revision$"
  
--- 21,25 ----
   *****************************************************************************/
  
! const char *progname = "check_ldap";
  #define REVISION "$Revision$"
  
***************
*** 36,41 ****
  int process_arguments (int, char **);
  int validate_arguments (void);
! static void print_help (void);
! static void print_usage (void);
  
  char ld_defattr[] = "(objectclass=*)";
--- 36,41 ----
  int process_arguments (int, char **);
  int validate_arguments (void);
! void print_help (void);
! void print_usage (void);
  
  char ld_defattr[] = "(objectclass=*)";
***************
*** 166,170 ****
  			exit (STATE_OK);
  		case 'V':									/* version */
! 			print_revision (PROGNAME, REVISION);
  			exit (STATE_OK);
  		case 't':									/* timeout period */
--- 166,170 ----
  			exit (STATE_OK);
  		case 'V':									/* version */
! 			print_revision (progname, REVISION);
  			exit (STATE_OK);
  		case 't':									/* timeout period */
***************
*** 226,233 ****
  
  /* function print_help */
! static void
  print_help ()
  {
! 	print_revision (PROGNAME, REVISION);
  	printf
  		("Copyright (c) 1999 Didi Rieder (adrieder at sbox.tu-graz.ac.at)\n"
--- 226,233 ----
  
  /* function print_help */
! void
  print_help ()
  {
! 	print_revision (progname, REVISION);
  	printf
  		("Copyright (c) 1999 Didi Rieder (adrieder at sbox.tu-graz.ac.at)\n"
***************
*** 249,253 ****
  
  
! static void
  print_usage ()
  {
--- 249,253 ----
  
  
! void
  print_usage ()
  {
***************
*** 255,258 ****
  		("Usage: %s -H <host> -b <base_dn> -p <port> [-a <attr>] [-D <binddn>]\n"
  		 "         [-P <password>] [-w <warn_time>] [-c <crit_time>] [-t timeout]\n"
! 		 "(Note: all times are in seconds.)\n", PROGNAME);
  }
--- 255,258 ----
  		("Usage: %s -H <host> -b <base_dn> -p <port> [-a <attr>] [-D <binddn>]\n"
  		 "         [-P <password>] [-w <warn_time>] [-c <crit_time>] [-t timeout]\n"
! 		 "(Note: all times are in seconds.)\n", progname);
  }

Index: check_load.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_load.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** check_load.c	8 Nov 2002 07:18:49 -0000	1.4
--- check_load.c	13 Jan 2003 12:15:16 -0000	1.5
***************
*** 45,49 ****
  #endif
  
! #define PROGNAME "check_load"
  
  int process_arguments (int argc, char **argv);
--- 45,49 ----
  #endif
  
! const char *progname = "check_load";
  
  int process_arguments (int argc, char **argv);
***************
*** 213,217 ****
  			break;
  		case 'V':									/* version */
! 			print_revision (my_basename (argv[0]), "$Revision$");
  			exit (STATE_OK);
  		case 'h':									/* help */
--- 213,217 ----
  			break;
  		case 'V':									/* version */
! 			print_revision (progname, "$Revision$");
  			exit (STATE_OK);
  		case 'h':									/* help */
***************
*** 304,308 ****
  print_help (void)
  {
! 	print_revision (PROGNAME, "$Revision$");
  	printf
  		("Copyright (c) 1999 Felipe Gustavo de Almeida <galmeida at linux.ime.usp.br>\n"
--- 304,308 ----
  print_help (void)
  {
! 	print_revision (progname, "$Revision$");
  	printf
  		("Copyright (c) 1999 Felipe Gustavo de Almeida <galmeida at linux.ime.usp.br>\n"

Index: check_mrtg.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_mrtg.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** check_mrtg.c	14 Nov 2002 02:26:34 -0000	1.3
--- check_mrtg.c	13 Jan 2003 12:15:16 -0000	1.4
***************
*** 24,28 ****
   *****************************************************************************/
  
! #define PROGNAME "check_mrtg"
  #define REVISION "$Revision$"
  #define COPYRIGHT "Copyright (c) 1999-2001 Ethan Galstad"
--- 24,28 ----
   *****************************************************************************/
  
! const char *progname = "check_mrtg";
  #define REVISION "$Revision$"
  #define COPYRIGHT "Copyright (c) 1999-2001 Ethan Galstad"
***************
*** 288,292 ****
  			break;
  		case 'V':									/* version */
! 			print_revision (PROGNAME, REVISION);
  			exit (STATE_OK);
  		case 'h':									/* help */
--- 288,292 ----
  			break;
  		case 'V':									/* version */
! 			print_revision (progname, REVISION);
  			exit (STATE_OK);
  		case 'h':									/* help */
***************
*** 309,313 ****
  			terminate (STATE_UNKNOWN,
  			           "%s is not a valid expiration time\nUse '%s -h' for additional help\n",
! 			           argv[c], PROGNAME);
  	}
  
--- 309,313 ----
  			terminate (STATE_UNKNOWN,
  			           "%s is not a valid expiration time\nUse '%s -h' for additional help\n",
! 			           argv[c], progname);
  	}
  
***************
*** 360,364 ****
  print_help (void)
  {
! 	print_revision (PROGNAME, REVISION);
  	printf ("%s\n\n%s\n", COPYRIGHT, SUMMARY);
  	print_usage ();
--- 360,364 ----
  print_help (void)
  {
! 	print_revision (progname, REVISION);
  	printf ("%s\n\n%s\n", COPYRIGHT, SUMMARY);
  	print_usage ();
***************
*** 378,381 ****
  					" %s -V for version information\n",
  #endif
! 					PROGNAME, OPTIONS, PROGNAME, PROGNAME);
  }
--- 378,381 ----
  					" %s -V for version information\n",
  #endif
! 					progname, OPTIONS, progname, progname);
  }

Index: check_mrtgtraf.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_mrtgtraf.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** check_mrtgtraf.c	14 Nov 2002 02:26:34 -0000	1.2
--- check_mrtgtraf.c	13 Jan 2003 12:15:16 -0000	1.3
***************
*** 53,57 ****
  #include "utils.h"
  
! #define PROGNAME "check_mrtgtraf"
  
  int process_arguments (int, char **);
--- 53,57 ----
  #include "utils.h"
  
! const char *progname = "check_mrtgtraf";
  
  int process_arguments (int, char **);
***************
*** 293,297 ****
  			break;
  		case 'V':									/* version */
! 			print_revision (PROGNAME, "$Revision$");
  			exit (STATE_OK);
  		case 'h':									/* help */
--- 293,297 ----
  			break;
  		case 'V':									/* version */
! 			print_revision (progname, "$Revision$");
  			exit (STATE_OK);
  		case 'h':									/* help */
***************
*** 357,361 ****
  print_help (void)
  {
! 	print_revision (PROGNAME, "$Revision$");
  	printf
  		("Copyright (c) 2000 Tom Shields/Karl DeBisschop\n\n"
--- 357,361 ----
  print_help (void)
  {
! 	print_revision (progname, "$Revision$");
  	printf
  		("Copyright (c) 2000 Tom Shields/Karl DeBisschop\n\n"
***************
*** 391,394 ****
  		 "            [-e expire_minutes] [-t timeout] [-v]\n"
  		 "       %s --help\n"
! 		 "       %s --version\n", PROGNAME, PROGNAME, PROGNAME);
  }
--- 391,394 ----
  		 "            [-e expire_minutes] [-t timeout] [-v]\n"
  		 "       %s --help\n"
! 		 "       %s --version\n", progname, progname, progname);
  }

Index: check_mysql.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_mysql.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** check_mysql.c	12 Nov 2002 11:26:01 -0000	1.2
--- check_mysql.c	13 Jan 2003 12:15:16 -0000	1.3
***************
*** 15,19 ****
  ******************************************************************************/
  
! #define PROGNAME "check_mysql"
  #define REVISION "$Revision$"
  #define COPYRIGHT "1999-2002"
--- 15,19 ----
  ******************************************************************************/
  
! const char *progname = "check_mysql"
  #define REVISION "$Revision$"
  #define COPYRIGHT "1999-2002"
***************
*** 179,183 ****
  			break;
  		case 'V':									/* version */
! 			print_revision (PROGNAME, REVISION);
  			exit (STATE_OK);
  		case 'h':									/* help */
--- 179,183 ----
  			break;
  		case 'V':									/* version */
! 			print_revision (progname, REVISION);
  			exit (STATE_OK);
  		case 'h':									/* help */
***************
*** 231,235 ****
  print_help (void)
  {
! 	print_revision (PROGNAME, REVISION);
  	printf
  		("Copyright (c) 2000 Didi Rieder/Karl DeBisschop\n\n"
--- 231,235 ----
  print_help (void)
  {
! 	print_revision (progname, REVISION);
  	printf
  		("Copyright (c) 2000 Didi Rieder/Karl DeBisschop\n\n"
***************
*** 268,271 ****
  		("Usage: %s [-d database] [-H host] [-P port] [-u user] [-p password]\n"
  		 "       %s --help\n"
! 		 "       %s --version\n", PROGNAME, PROGNAME, PROGNAME);
  }
--- 268,271 ----
  		("Usage: %s [-d database] [-H host] [-P port] [-u user] [-p password]\n"
  		 "       %s --help\n"
! 		 "       %s --version\n", progname, progname, progname);
  }

Index: check_nagios.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_nagios.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** check_nagios.c	13 Jan 2003 12:09:49 -0000	1.3
--- check_nagios.c	13 Jan 2003 12:15:16 -0000	1.4
***************
*** 31,35 ****
  #include "utils.h"
  
! const char *PROGNAME = "check_nagios";
  
  int process_arguments (int, char **);
--- 31,35 ----
  #include "utils.h"
  
! const char *progname = "check_nagios";
  
  int process_arguments (int, char **);
***************
*** 167,171 ****
  			terminate (STATE_UNKNOWN,
  								 "Expiration time must be an integer (seconds)\nType '%s -h' for additional help\n",
! 								 PROGNAME);
  		process_string = argv[3];
  		return OK;
--- 167,171 ----
  			terminate (STATE_UNKNOWN,
  								 "Expiration time must be an integer (seconds)\nType '%s -h' for additional help\n",
! 								 progname);
  		process_string = argv[3];
  		return OK;
***************
*** 184,188 ****
  		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);
--- 184,188 ----
  		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);
***************
*** 191,195 ****
  			exit (STATE_OK);
  		case 'V':									/* version */
! 			print_revision (PROGNAME, "$Revision$");
  			exit (STATE_OK);
  		case 'F':									/* hostname */
--- 191,195 ----
  			exit (STATE_OK);
  		case 'V':									/* version */
! 			print_revision (progname, "$Revision$");
  			exit (STATE_OK);
  		case 'F':									/* hostname */
***************
*** 205,209 ****
  				terminate (STATE_UNKNOWN,
  									 "Expiration time must be an integer (seconds)\nType '%s -h' for additional help\n",
! 									 PROGNAME);
  			break;
  		}
--- 205,209 ----
  				terminate (STATE_UNKNOWN,
  									 "Expiration time must be an integer (seconds)\nType '%s -h' for additional help\n",
! 									 progname);
  			break;
  		}
***************
*** 214,222 ****
  		terminate (STATE_UNKNOWN,
  							 "You must provide the status_log\nType '%s -h' for additional help\n",
! 							 PROGNAME);
  	else if (process_string == NULL)
  		terminate (STATE_UNKNOWN,
  							 "You must provide a process string\nType '%s -h' for additional help\n",
! 							 PROGNAME);
  
  	return OK;
--- 214,222 ----
  		terminate (STATE_UNKNOWN,
  							 "You must provide the status_log\nType '%s -h' for additional help\n",
! 							 progname);
  	else if (process_string == NULL)
  		terminate (STATE_UNKNOWN,
  							 "You must provide a process string\nType '%s -h' for additional help\n",
! 							 progname);
  
  	return OK;
***************
*** 232,236 ****
  	printf
  		("Usage: %s -F <status log file> -e <expire_minutes> -C <process_string>\n",
! 		 PROGNAME);
  }
  
--- 232,236 ----
  	printf
  		("Usage: %s -F <status log file> -e <expire_minutes> -C <process_string>\n",
! 		 progname);
  }
  
***************
*** 242,246 ****
  print_help (void)
  {
! 	print_revision (PROGNAME, "$Revision$");
  	printf
  		("Copyright (c) 2000 Ethan Galstad/Karl DeBisschop\n\n"
--- 242,246 ----
  print_help (void)
  {
! 	print_revision (progname, "$Revision$");
  	printf
  		("Copyright (c) 2000 Ethan Galstad/Karl DeBisschop\n\n"

Index: check_nwstat.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_nwstat.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** check_nwstat.c	14 Nov 2002 02:26:34 -0000	1.3
--- check_nwstat.c	13 Jan 2003 12:15:16 -0000	1.4
***************
*** 24,28 ****
   *****************************************************************************/
  
! #define PROGNAME "check_nwstat"
  #define REVISION "$Revision$"
  #define COPYRIGHT "Copyright (c) 1999-2001 Ethan Galstad"
--- 24,28 ----
   *****************************************************************************/
  
! const char *progname = "check_nwstat";
  #define REVISION "$Revision$"
  #define COPYRIGHT "Copyright (c) 1999-2001 Ethan Galstad"
***************
*** 129,134 ****
  int sap_number=-1;
  
- #define PROGNAME "check_nwstat"
- 
  int process_arguments(int, char **);
  void print_usage(void);
--- 129,132 ----
***************
*** 675,679 ****
  			{
  			case '?': /* print short usage statement if args not parsable */
! 				printf("%s: Unknown argument: %s\n\n",my_basename(argv[0]),optarg);
  				print_usage();
  				exit(STATE_UNKNOWN);
--- 673,677 ----
  			{
  			case '?': /* print short usage statement if args not parsable */
! 				printf ("%s: Unknown argument: %s\n\n", progname, optarg);
  				print_usage();
  				exit(STATE_UNKNOWN);
***************
*** 682,686 ****
  				exit(STATE_OK);
  			case 'V': /* version */
! 				print_revision(my_basename(argv[0]),"$Revision$");
  				exit(STATE_OK);
  			case 'H': /* hostname */
--- 680,684 ----
  				exit(STATE_OK);
  			case 'V': /* version */
! 				print_revision(progname,"$Revision$");
  				exit(STATE_OK);
  			case 'H': /* hostname */
***************
*** 694,698 ****
  					server_port=atoi(optarg);
  				else
! 					terminate(STATE_UNKNOWN,"Server port an integer (seconds)\nType '%s -h' for additional help\n",PROGNAME);
  				break;
  			case 'v':
--- 692,696 ----
  					server_port=atoi(optarg);
  				else
! 					terminate(STATE_UNKNOWN,"Server port an integer (seconds)\nType '%s -h' for additional help\n",progname);
  				break;
  			case 'v':
***************
*** 807,816 ****
  		 " %s -V for version information\n",
  #endif
! 		 PROGNAME, OPTIONS, PROGNAME, PROGNAME);
  }
  
  void print_help(void)
  {
! 	print_revision (PROGNAME, REVISION);
  	printf ("%s\n\n%s\n", COPYRIGHT, SUMMARY);
  	print_usage();
--- 805,814 ----
  		 " %s -V for version information\n",
  #endif
! 		 progname, OPTIONS, progname, progname);
  }
  
  void print_help(void)
  {
! 	print_revision (progname, REVISION);
  	printf ("%s\n\n%s\n", COPYRIGHT, SUMMARY);
  	print_usage();

Index: check_overcr.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_overcr.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** check_overcr.c	28 Feb 2002 06:42:58 -0000	1.1.1.1
--- check_overcr.c	13 Jan 2003 12:15:16 -0000	1.2
***************
*** 59,63 ****
  #define PORT	2000
  
! #define PROGNAME "check_overcr"
  
  char *server_address = NULL;
--- 59,63 ----
  #define PORT	2000
  
! const char *progname = "check_overcr";
  
  char *server_address = NULL;
***************
*** 368,372 ****
  		switch (c) {
  		case '?':									/* print short usage statement if args not parsable */
! 			printf ("%s: Unknown argument: %s\n\n", my_basename (argv[0]), optarg);
  			print_usage ();
  			exit (STATE_UNKNOWN);
--- 368,372 ----
  		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);
***************
*** 375,379 ****
  			exit (STATE_OK);
  		case 'V':									/* version */
! 			print_revision (my_basename (argv[0]), "$Revision$");
  			exit (STATE_OK);
  		case 'H':									/* hostname */
--- 375,379 ----
  			exit (STATE_OK);
  		case 'V':									/* version */
! 			print_revision (progname, "$Revision$");
  			exit (STATE_OK);
  		case 'H':									/* hostname */
***************
*** 386,390 ****
  				terminate (STATE_UNKNOWN,
  									 "Server port an integer (seconds)\nType '%s -h' for additional help\n",
! 									 PROGNAME);
  			break;
  		case 'v':									/* variable */
--- 386,390 ----
  				terminate (STATE_UNKNOWN,
  									 "Server port an integer (seconds)\nType '%s -h' for additional help\n",
! 									 progname);
  			break;
  		case 'v':									/* variable */
***************
*** 439,443 ****
  	printf
  		("Usage: %s -H host [-p port] [-v variable] [-w warning] [-c critical] [-t timeout]\n",
! 		 PROGNAME);
  }
  
--- 439,443 ----
  	printf
  		("Usage: %s -H host [-p port] [-v variable] [-w warning] [-c critical] [-t timeout]\n",
! 		 progname);
  }
  
***************
*** 449,453 ****
  print_help (void)
  {
! 	print_revision (PROGNAME, "$Revision$");
  	printf
  		("Copyright (c) 2000 Ethan Galstad/Karl DeBisschop\n\n"
--- 449,453 ----
  print_help (void)
  {
! 	print_revision (progname, "$Revision$");
  	printf
  		("Copyright (c) 2000 Ethan Galstad/Karl DeBisschop\n\n"

Index: check_pgsql.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_pgsql.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** check_pgsql.c	9 Nov 2002 03:39:35 -0000	1.3
--- check_pgsql.c	13 Jan 2003 12:15:16 -0000	1.4
***************
*** 24,28 ****
   *****************************************************************************/
  
! #define PROGNAME "check_pgsql"
  #define REVISION "$Revision$"
  #define COPYRIGHT "1999-2001"
--- 24,28 ----
   *****************************************************************************/
  
! const char *progname = "check_pgsql"
  #define REVISION "$Revision$"
  #define COPYRIGHT "1999-2001"
***************
*** 123,127 ****
  </refmeta>
  <refnamdiv>
! <refname>&PROGNAME;</refname>
  <refpurpose>&SUMMARY;</refpurpose>
  </refnamdiv>
--- 123,127 ----
  </refmeta>
  <refnamdiv>
! <refname>&progname;</refname>
  <refpurpose>&SUMMARY;</refpurpose>
  </refnamdiv>
***************
*** 219,223 ****
  print_help (void)
  {
! 	print_revision (PROGNAME, REVISION);
  	printf
  		("Copyright (c) %s %s <%s>\n\n%s\n",
--- 219,223 ----
  print_help (void)
  {
! 	print_revision (progname, REVISION);
  	printf
  		("Copyright (c) %s %s <%s>\n\n%s\n",
***************
*** 236,240 ****
  					" %s (-h | --help) for detailed help\n"
  					" %s (-V | --version) for version information\n",
! 					PROGNAME, OPTIONS, PROGNAME, PROGNAME);
  }
  
--- 236,240 ----
  					" %s (-h | --help) for detailed help\n"
  					" %s (-V | --version) for version information\n",
! 					progname, OPTIONS, progname, progname);
  }
  
***************
*** 282,286 ****
  			exit (STATE_OK);
  		case 'V':     /* version */
! 			print_revision (PROGNAME, REVISION);
  			exit (STATE_OK);
  		case 't':     /* timeout period */
--- 282,286 ----
  			exit (STATE_OK);
  		case 'V':     /* version */
! 			print_revision (progname, REVISION);
  			exit (STATE_OK);
  		case 't':     /* timeout period */

Index: check_ping.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_ping.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** check_ping.c	13 Nov 2002 11:50:54 -0000	1.10
--- check_ping.c	13 Jan 2003 12:15:16 -0000	1.11
***************
*** 11,15 ****
  *****************************************************************************/
  
! #define PROGNAME "check_ping"
  #define REVISION "$Revision$"
  #define COPYRIGHT "1999-2001"
--- 11,15 ----
  *****************************************************************************/
  
! const char *progname = "check_ping";
  #define REVISION "$Revision$"
  #define COPYRIGHT "1999-2001"
***************
*** 190,194 ****
  			exit (STATE_OK);
  		case 'V':	/* version */
! 			print_revision (PROGNAME, REVISION);
  			exit (STATE_OK);
  		case 't':	/* timeout period */
--- 190,194 ----
  			exit (STATE_OK);
  		case 'V':	/* version */
! 			print_revision (progname, REVISION);
  			exit (STATE_OK);
  		case 't':	/* timeout period */
***************
*** 483,487 ****
  					" %s -V for version information\n",
  #endif
! 					PROGNAME, OPTIONS, PROGNAME, PROGNAME);
  }
  
--- 483,487 ----
  					" %s -V for version information\n",
  #endif
! 					progname, OPTIONS, progname, progname);
  }
  
***************
*** 489,493 ****
  print_help (void)
  {
! 	print_revision (PROGNAME, REVISION);
  	printf
  		("Copyright (c) %s %s <%s>\n\n%s\n",
--- 489,493 ----
  print_help (void)
  {
! 	print_revision (progname, REVISION);
  	printf
  		("Copyright (c) %s %s <%s>\n\n%s\n",

Index: check_procs.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_procs.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** check_procs.c	22 Nov 2002 01:33:26 -0000	1.5
--- check_procs.c	13 Jan 2003 12:15:16 -0000	1.6
***************
*** 35,39 ****
  ******************************************************************************/
  
! #define PROGNAME "check_snmp"
  #define REVISION "$Revision$"
  #define COPYRIGHT "1999-2002"
--- 35,39 ----
  ******************************************************************************/
  
! const char *progname = "check_snmp";
  #define REVISION "$Revision$"
  #define COPYRIGHT "1999-2002"
***************
*** 299,308 ****
  			exit (STATE_OK);
  		case 'V':									/* version */
! 			print_revision (PROGNAME, REVISION);
  			exit (STATE_OK);
  		case 't':									/* timeout period */
  			if (!is_integer (optarg)) {
  				printf ("%s: Timeout Interval must be an integer!\n\n",
! 				        my_basename (argv[0]));
  				print_usage ();
  				exit (STATE_UNKNOWN);
--- 299,308 ----
  			exit (STATE_OK);
  		case 'V':									/* version */
! 			print_revision (progname, REVISION);
  			exit (STATE_OK);
  		case 't':									/* timeout period */
  			if (!is_integer (optarg)) {
  				printf ("%s: Timeout Interval must be an integer!\n\n",
! 				        progname);
  				print_usage ();
  				exit (STATE_UNKNOWN);
***************
*** 326,330 ****
  			else {
  				printf ("%s: Critical Process Count must be an integer!\n\n",
! 				        my_basename (argv[0]));
  				print_usage ();
  				exit (STATE_UNKNOWN);
--- 326,330 ----
  			else {
  				printf ("%s: Critical Process Count must be an integer!\n\n",
! 				        progname);
  				print_usage ();
  				exit (STATE_UNKNOWN);
***************
*** 346,350 ****
  			else {
  				printf ("%s: Warning Process Count must be an integer!\n\n",
! 				        my_basename (argv[0]));
  				print_usage ();
  				exit (STATE_UNKNOWN);
--- 346,350 ----
  			else {
  				printf ("%s: Warning Process Count must be an integer!\n\n",
! 				        progname);
  				print_usage ();
  				exit (STATE_UNKNOWN);
***************
*** 357,361 ****
  			}
  			printf ("%s: Parent Process ID must be an integer!\n\n",
! 			        my_basename (argv[0]));
  			print_usage ();
  			exit (STATE_UNKNOWN);
--- 357,361 ----
  			}
  			printf ("%s: Parent Process ID must be an integer!\n\n",
! 			        progname);
  			print_usage ();
  			exit (STATE_UNKNOWN);
***************
*** 463,467 ****
  print_help (void)
  {
! 	print_revision (PROGNAME, REVISION);
  	printf
  		("Copyright (c) %s %s <%s>\n\n%s\n",
--- 463,467 ----
  print_help (void)
  {
! 	print_revision (progname, REVISION);
  	printf
  		("Copyright (c) %s %s <%s>\n\n%s\n",

Index: check_radius.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_radius.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** check_radius.c	14 Nov 2002 02:26:34 -0000	1.2
--- check_radius.c	13 Jan 2003 12:15:16 -0000	1.3
***************
*** 24,28 ****
   *****************************************************************************/
  
! #define PROGNAME "check_radius"
  #define REVISION "$Revision$"
  #define COPYRIGHT "1999-2001"
--- 24,28 ----
   *****************************************************************************/
  
! const char *progname = "check_radius"
  #define REVISION "$Revision$"
  #define COPYRIGHT "1999-2001"
***************
*** 113,117 ****
  </refmeta>
  <refnamdiv>
! <refname>&PROGNAME;</refname>
  <refpurpose>&SUMMARY;</refpurpose>
  </refnamdiv>
--- 113,117 ----
  </refmeta>
  <refnamdiv>
! <refname>&progname;</refname>
  <refpurpose>&SUMMARY;</refpurpose>
  </refnamdiv>
***************
*** 265,269 ****
  		switch (c) {
  		case '?':									/* print short usage statement if args not parsable */
! 			printf ("%s: Unknown argument: %s\n\n", my_basename (argv[0]), optarg);
  			print_usage ();
  			exit (STATE_UNKNOWN);
--- 265,269 ----
  		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);
***************
*** 272,276 ****
  			exit (OK);
  		case 'V':									/* version */
! 			print_revision (my_basename (argv[0]), "$Revision$");
  			exit (OK);
  		case 'v':									/* verbose mode */
--- 272,276 ----
  			exit (OK);
  		case 'V':									/* version */
! 			print_revision (progname, "$Revision$");
  			exit (OK);
  		case 'v':									/* verbose mode */
***************
*** 325,329 ****
  print_help (void)
  {
! 	print_revision (PROGNAME, REVISION);
  	printf
  		("Copyright (c) %s %s <%s>\n\n%s\n",
--- 325,329 ----
  print_help (void)
  {
! 	print_revision (progname, REVISION);
  	printf
  		("Copyright (c) %s %s <%s>\n\n%s\n",
***************
*** 348,351 ****
  					" %s -V for version information\n",
  #endif
! 					PROGNAME, OPTIONS, PROGNAME, PROGNAME);
  }
--- 348,351 ----
  					" %s -V for version information\n",
  #endif
! 					progname, OPTIONS, progname, progname);
  }

Index: check_real.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_real.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** check_real.c	12 Nov 2002 11:26:01 -0000	1.2
--- check_real.c	13 Jan 2003 12:15:16 -0000	1.3
***************
*** 49,53 ****
  #include "utils.h"
  
! #define PROGNAME "check_real"
  
  #define PORT	554
--- 49,53 ----
  #include "utils.h"
  
! const char *progname = "check_real";
  
  #define PORT	554
***************
*** 371,375 ****
  			break;
  		case 'V':									/* version */
! 			print_revision (PROGNAME, "$Revision$");
  			exit (STATE_OK);
  		case 'h':									/* help */
--- 371,375 ----
  			break;
  		case 'V':									/* version */
! 			print_revision (progname, "$Revision$");
  			exit (STATE_OK);
  		case 'h':									/* help */
***************
*** 411,415 ****
  print_help (void)
  {
! 	print_revision (PROGNAME, "$Revision$");
  	printf
  		("Copyright (c) 2000 Pedro Leite (leite at cic.ua.pt)/Karl DeBisschop\n\n"
--- 411,415 ----
  print_help (void)
  {
! 	print_revision (progname, "$Revision$");
  	printf
  		("Copyright (c) 2000 Pedro Leite (leite at cic.ua.pt)/Karl DeBisschop\n\n"
***************
*** 455,459 ****
  		 "            [-t timeout] [-v]\n"
  		 "       %s --help\n"
! 		 "       %s --version\n", PROGNAME, PROGNAME, PROGNAME);
  }
  
--- 455,459 ----
  		 "            [-t timeout] [-v]\n"
  		 "       %s --help\n"
! 		 "       %s --version\n", progname, progname, progname);
  }
  

Index: check_smtp.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_smtp.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** check_smtp.c	8 Nov 2002 07:18:49 -0000	1.8
--- check_smtp.c	13 Jan 2003 12:15:16 -0000	1.9
***************
*** 40,44 ****
  #include "utils.h"
  
! #define PROGNAME "check_smtp"
  
  #define SMTP_PORT	25
--- 40,44 ----
  #include "utils.h"
  
! const char *progname = "check_smtp";
  
  #define SMTP_PORT	25
***************
*** 295,299 ****
  			break;
  		case 'V':									/* version */
! 			print_revision (PROGNAME, "$Revision$");
  			exit (STATE_OK);
  		case 'h':									/* help */
--- 295,299 ----
  			break;
  		case 'V':									/* version */
! 			print_revision (progname, "$Revision$");
  			exit (STATE_OK);
  		case 'h':									/* help */
***************
*** 341,345 ****
  print_help (void)
  {
! 	print_revision (PROGNAME, "$Revision$");
  	printf
  		("Copyright (c) 2000 Ethan Galstad/Karl DeBisschop\n\n"
--- 341,345 ----
  print_help (void)
  {
! 	print_revision (progname, "$Revision$");
  	printf
  		("Copyright (c) 2000 Ethan Galstad/Karl DeBisschop\n\n"
***************
*** 382,385 ****
  		("Usage: %s -H host [-e expect] [-p port] [-f from addr] [-w warn] [-c crit] [-t timeout] [-v]\n"
  		 "       %s --help\n"
! 		 "       %s --version\n", PROGNAME, PROGNAME, PROGNAME);
  }
--- 382,385 ----
  		("Usage: %s -H host [-e expect] [-p port] [-f from addr] [-w warn] [-c crit] [-t timeout] [-v]\n"
  		 "       %s --help\n"
! 		 "       %s --version\n", progname, progname, progname);
  }

Index: check_snmp.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_snmp.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -r1.20 -r1.21
*** check_snmp.c	16 Nov 2002 04:59:35 -0000	1.20
--- check_snmp.c	13 Jan 2003 12:15:16 -0000	1.21
***************
*** 24,28 ****
   *****************************************************************************/
  
! #define PROGNAME "check_snmp"
  #define REVISION "$Revision$"
  #define COPYRIGHT "1999-2002"
--- 24,28 ----
   *****************************************************************************/
  
! const char *progname = "check_snmp";
  #define REVISION "$Revision$"
  #define COPYRIGHT "1999-2002"
***************
*** 476,480 ****
  			exit (STATE_OK); 
  		case 'V':	/* version */
! 			print_revision (PROGNAME, REVISION);
  			exit (STATE_OK);
  		case 'v': /* verbose */
--- 476,480 ----
  			exit (STATE_OK); 
  		case 'V':	/* version */
! 			print_revision (progname, REVISION);
  			exit (STATE_OK);
  		case 'v': /* verbose */
***************
*** 754,761 ****
  print_help (void)
  {
! 	print_revision (PROGNAME, REVISION);
  	printf
! 		("Copyright (c) %s %s <%s>\n\n%s\n",
! 		 COPYRIGHT, AUTHOR, EMAIL, SUMMARY);
  	print_usage ();
  	printf
--- 754,760 ----
  print_help (void)
  {
! 	print_revision (progname, REVISION);
  	printf
! 		("Copyright (c) %s %s <%s>\n\n%s\n", COPYRIGHT, AUTHOR, EMAIL, SUMMARY);
  	print_usage ();
  	printf
***************
*** 772,776 ****
  		 " %s (-h | --help) for detailed help\n"
  		 " %s (-V | --version) for version information\n",
! 		 PROGNAME, OPTIONS, PROGNAME, PROGNAME);
  }
  
--- 771,775 ----
  		 " %s (-h | --help) for detailed help\n"
  		 " %s (-V | --version) for version information\n",
! 		 progname, OPTIONS, progname, progname);
  }
  

Index: check_ssh.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_ssh.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** check_ssh.c	30 Oct 2002 18:44:43 -0000	1.3
--- check_ssh.c	13 Jan 2003 12:15:16 -0000	1.4
***************
*** 16,20 ****
  #include "utils.h"
  
! #define PROGNAME "check_ssh"
  #define REVISION "$Revision$"
  
--- 16,20 ----
  #include "utils.h"
  
! const char *progname = "check_ssh";
  #define REVISION "$Revision$"
  
***************
*** 96,100 ****
  			usage ("");
  		case 'V':									/* version */
! 			print_revision (PROGNAME, REVISION);
  			exit (STATE_OK);
  		case 'h':									/* help */
--- 96,100 ----
  			usage ("");
  		case 'V':									/* version */
! 			print_revision (progname, REVISION);
  			exit (STATE_OK);
  		case 'h':									/* help */
***************
*** 239,243 ****
  print_help (void)
  {
! 	print_revision (PROGNAME, REVISION);
  	printf ("Copyright (c) 1999 Remi Paulmier (remi at sinfomic.fr)\n\n");
  	print_usage ();
--- 239,243 ----
  print_help (void)
  {
! 	print_revision (progname, REVISION);
  	printf ("Copyright (c) 1999 Remi Paulmier (remi at sinfomic.fr)\n\n");
  	print_usage ();
***************
*** 252,256 ****
  		 " %s -t [timeout] -p [port] <host>\n"
  		 " %s -V prints version info\n"
! 		 " %s -h prints more detailed help\n", PROGNAME, PROGNAME, PROGNAME);
  }
  
--- 252,256 ----
  		 " %s -t [timeout] -p [port] <host>\n"
  		 " %s -V prints version info\n"
! 		 " %s -h prints more detailed help\n", progname, progname, progname);
  }
  

Index: check_swap.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_swap.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** check_swap.c	20 Nov 2002 11:56:11 -0000	1.6
--- check_swap.c	13 Jan 2003 12:15:16 -0000	1.7
***************
*** 30,34 ****
  #include "utils.h"
  
! #define PROGNAME "check_swap"
  #define REVISION "$Revision$"
  #define COPYRIGHT "2000-2002"
--- 30,34 ----
  #include "utils.h"
  
! const char *progname = "check_swap";
  #define REVISION "$Revision$"
  #define COPYRIGHT "2000-2002"
***************
*** 268,272 ****
  			break;
  		case 'V':									/* version */
! 			print_revision (my_basename (argv[0]), "$Revision$");
  			exit (STATE_OK);
  		case 'h':									/* help */
--- 268,272 ----
  			break;
  		case 'V':									/* version */
! 			print_revision (progname, "$Revision$");
  			exit (STATE_OK);
  		case 'h':									/* help */
***************
*** 337,341 ****
  		 " %s (-h | --help) for detailed help\n"
  		 " %s (-V | --version) for version information\n",
! 		 PROGNAME, PROGNAME, PROGNAME, PROGNAME);
  }
  
--- 337,341 ----
  		 " %s (-h | --help) for detailed help\n"
  		 " %s (-V | --version) for version information\n",
! 		 progname, progname, progname, progname);
  }
  
***************
*** 347,351 ****
  print_help (void)
  {
! 	print_revision (PROGNAME, REVISION);
  	printf
  		("Copyright (c) %s %s <%s>\n\n%s\n", COPYRIGHT, AUTHOR, EMAIL, SUMMARY);
--- 347,351 ----
  print_help (void)
  {
! 	print_revision (progname, REVISION);
  	printf
  		("Copyright (c) %s %s <%s>\n\n%s\n", COPYRIGHT, AUTHOR, EMAIL, SUMMARY);

Index: check_tcp.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_tcp.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** check_tcp.c	19 Dec 2002 19:30:52 -0000	1.10
--- check_tcp.c	13 Jan 2003 12:15:16 -0000	1.11
***************
*** 23,27 ****
   *****************************************************************************/
  
! #define PROGRAM check_tcp
  #define REVISION "$Revision$"
  #define DESCRIPTION "Check a TCP port"
--- 23,27 ----
   *****************************************************************************/
  
! /* const char *progname = "check_tcp"; */
  #define REVISION "$Revision$"
  #define DESCRIPTION "Check a TCP port"
***************
*** 66,70 ****
  void print_help (void);
  
! char *PROGNAME = NULL;
  char *SERVICE = NULL;
  char *SEND = NULL;
--- 66,70 ----
  void print_help (void);
  
! char *progname = NULL;
  char *SERVICE = NULL;
  char *SEND = NULL;
***************
*** 104,108 ****
  
  	if (strstr (argv[0], "check_udp")) {
! 		asprintf (&PROGNAME, "check_udp");
  		asprintf (&SERVICE, "UDP");
  		SEND = NULL;
--- 104,108 ----
  
  	if (strstr (argv[0], "check_udp")) {
! 		asprintf (&progname, "check_udp");
  		asprintf (&SERVICE, "UDP");
  		SEND = NULL;
***************
*** 113,117 ****
  	}
  	else if (strstr (argv[0], "check_tcp")) {
! 		asprintf (&PROGNAME, "check_tcp");
  		asprintf (&SERVICE, "TCP");
  		SEND = NULL;
--- 113,117 ----
  	}
  	else if (strstr (argv[0], "check_tcp")) {
! 		asprintf (&progname, "check_tcp");
  		asprintf (&SERVICE, "TCP");
  		SEND = NULL;
***************
*** 122,126 ****
  	}
  	else if (strstr (argv[0], "check_ftp")) {
! 		asprintf (&PROGNAME, "check_ftp");
  		asprintf (&SERVICE, "FTP");
  		SEND = NULL;
--- 122,126 ----
  	}
  	else if (strstr (argv[0], "check_ftp")) {
! 		asprintf (&progname, "check_ftp");
  		asprintf (&SERVICE, "FTP");
  		SEND = NULL;
***************
*** 131,135 ****
  	}
  	else if (strstr (argv[0], "check_smtp")) {
! 		asprintf (&PROGNAME, "check_smtp");
  		asprintf (&SERVICE, "SMTP");
  		SEND = NULL;
--- 131,135 ----
  	}
  	else if (strstr (argv[0], "check_smtp")) {
! 		asprintf (&progname, "check_smtp");
  		asprintf (&SERVICE, "SMTP");
  		SEND = NULL;
***************
*** 140,144 ****
  	}
  	else if (strstr (argv[0], "check_pop")) {
! 		asprintf (&PROGNAME, "check_pop");
  		asprintf (&SERVICE, "POP");
  		SEND = NULL;
--- 140,144 ----
  	}
  	else if (strstr (argv[0], "check_pop")) {
! 		asprintf (&progname, "check_pop");
  		asprintf (&SERVICE, "POP");
  		SEND = NULL;
***************
*** 149,153 ****
  	}
  	else if (strstr (argv[0], "check_imap")) {
! 		asprintf (&PROGNAME, "check_imap");
  		asprintf (&SERVICE, "IMAP");
  		SEND = NULL;
--- 149,153 ----
  	}
  	else if (strstr (argv[0], "check_imap")) {
! 		asprintf (&progname, "check_imap");
  		asprintf (&SERVICE, "IMAP");
  		SEND = NULL;
***************
*** 159,163 ****
  #ifdef HAVE_SSL
  	else if (strstr(argv[0],"check_simap")) {
! 		asprintf (&PROGNAME, "check_simap");
  		asprintf (&SERVICE, "SIMAP");
  		SEND=NULL;
--- 159,163 ----
  #ifdef HAVE_SSL
  	else if (strstr(argv[0],"check_simap")) {
! 		asprintf (&progname, "check_simap");
  		asprintf (&SERVICE, "SIMAP");
  		SEND=NULL;
***************
*** 169,173 ****
  	}
  	else if (strstr(argv[0],"check_spop")) {
! 		asprintf (&PROGNAME, "check_spop");
  		asprintf (&SERVICE, "SPOP");
  		SEND=NULL;
--- 169,173 ----
  	}
  	else if (strstr(argv[0],"check_spop")) {
! 		asprintf (&progname, "check_spop");
  		asprintf (&SERVICE, "SPOP");
  		SEND=NULL;
***************
*** 180,184 ****
  #endif
  	else if (strstr (argv[0], "check_nntp")) {
! 		asprintf (&PROGNAME, "check_nntp");
  		asprintf (&SERVICE, "NNTP");
  		SEND = NULL;
--- 180,184 ----
  #endif
  	else if (strstr (argv[0], "check_nntp")) {
! 		asprintf (&progname, "check_nntp");
  		asprintf (&SERVICE, "NNTP");
  		SEND = NULL;
***************
*** 388,392 ****
  		switch (c) {
  		case '?':                 /* print short usage statement if args not parsable */
! 			printf ("%s: Unknown argument: %s\n\n", my_basename (argv[0]), optarg);
  			print_usage ();
  			exit (STATE_UNKNOWN);
--- 388,392 ----
  		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);
***************
*** 395,399 ****
  			exit (STATE_OK);
  		case 'V':                 /* version */
! 			print_revision (PROGNAME, "$Revision$");
  			exit (STATE_OK);
  		case 'v':                 /* verbose mode */
--- 395,399 ----
  			exit (STATE_OK);
  		case 'V':                 /* version */
! 			print_revision (progname, "$Revision$");
  			exit (STATE_OK);
  		case 'v':                 /* verbose mode */
***************
*** 402,406 ****
  		case 'H':                 /* hostname */
  			if (is_host (optarg) == FALSE)
! 				usage ("Invalid host name/address\n");
  			server_address = optarg;
  			break;
--- 402,406 ----
  		case 'H':                 /* hostname */
  			if (is_host (optarg) == FALSE)
! 				usage2 ("invalid host name or address", optarg);
  			server_address = optarg;
  			break;
***************
*** 480,484 ****
  	printf
  		("Usage: %s -H host -p port [-w warn_time] [-c crit_time] [-s send]\n"
! 		 "         [-e expect] [-W wait] [-t to_sec] [-v]\n", PROGNAME);
  }
  
--- 480,484 ----
  	printf
  		("Usage: %s -H host -p port [-w warn_time] [-c crit_time] [-s send]\n"
! 		 "         [-e expect] [-W wait] [-t to_sec] [-v]\n", progname);
  }
  
***************
*** 490,494 ****
  print_help (void)
  {
! 	print_revision (PROGNAME, "$Revision$");
  	printf
  		("Copyright (c) 1999 Ethan Galstad (nagios at nagios.org)\n\n"
--- 490,494 ----
  print_help (void)
  {
! 	print_revision (progname, "$Revision$");
  	printf
  		("Copyright (c) 1999 Ethan Galstad (nagios at nagios.org)\n\n"

Index: check_time.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_time.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** check_time.c	19 Nov 2002 19:06:55 -0000	1.3
--- check_time.c	13 Jan 2003 12:15:16 -0000	1.4
***************
*** 40,44 ****
  #include "utils.h"
  
! #define PROGNAME "check_time"
  #define REVISION "$Revision$"
  #define COPYRIGHT "1999-2002"
--- 40,44 ----
  #include "utils.h"
  
! const char *progname = "check_time";
  #define REVISION "$Revision$"
  #define COPYRIGHT "1999-2002"
***************
*** 210,214 ****
  			exit (STATE_OK);
  		case 'V':									/* version */
! 			print_revision (PROGNAME, REVISION);
  			exit (STATE_OK);
  		case 'H':									/* hostname */
--- 210,214 ----
  			exit (STATE_OK);
  		case 'V':									/* version */
! 			print_revision (progname, REVISION);
  			exit (STATE_OK);
  		case 'H':									/* hostname */
***************
*** 307,311 ****
  		 " %s (-h | --help) for detailed help\n"
  		 " %s (-V | --version) for version information\n",
! 		 PROGNAME, PROGNAME, PROGNAME);
  }
  
--- 307,311 ----
  		 " %s (-h | --help) for detailed help\n"
  		 " %s (-V | --version) for version information\n",
! 		 progname, progname, progname);
  }
  
***************
*** 317,321 ****
  print_help (void)
  {
! 	print_revision (PROGNAME, REVISION);
  	printf
  		("Copyright (c) %s %s <%s>\n\n%s\n",
--- 317,321 ----
  print_help (void)
  {
! 	print_revision (progname, REVISION);
  	printf
  		("Copyright (c) %s %s <%s>\n\n%s\n",

Index: check_udp.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_udp.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** check_udp.c	30 Oct 2002 18:46:01 -0000	1.2
--- check_udp.c	13 Jan 2003 12:15:16 -0000	1.3
***************
*** 42,46 ****
  #include "utils.h"
  
! #define PROGNAME "check_udp"
  
  int warning_time = 0;
--- 42,46 ----
  #include "utils.h"
  
! const char *progname = "check_udp";
  
  int warning_time = 0;
***************
*** 164,168 ****
  		switch (c) {
  		case '?':									/* print short usage statement if args not parsable */
! 			printf ("%s: Unknown argument: %s\n\n", my_basename (argv[0]), optarg);
  			print_usage ();
  			exit (STATE_UNKNOWN);
--- 164,168 ----
  		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);
***************
*** 171,175 ****
  			exit (STATE_OK);
  		case 'V':									/* version */
! 			print_revision (my_basename (argv[0]), "$Revision$");
  			exit (STATE_OK);
  		case 'v':									/* verbose mode */
--- 171,175 ----
  			exit (STATE_OK);
  		case 'V':									/* version */
! 			print_revision (progname, "$Revision$");
  			exit (STATE_OK);
  		case 'v':									/* verbose mode */
***************
*** 234,238 ****
  	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);
  }
  
--- 234,238 ----
  	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);
  }
  
***************
*** 244,248 ****
  print_help (void)
  {
! 	print_revision (PROGNAME, "$Revision$");
  	printf
  		("Copyright (c) 1999 Ethan Galstad (nagios at nagios.org)\n\n"
--- 244,248 ----
  print_help (void)
  {
! 	print_revision (progname, "$Revision$");
  	printf
  		("Copyright (c) 1999 Ethan Galstad (nagios at nagios.org)\n\n"

Index: check_ups.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_ups.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** check_ups.c	22 Nov 2002 10:52:18 -0000	1.5
--- check_ups.c	13 Jan 2003 12:15:16 -0000	1.6
***************
*** 57,61 ****
  #include "utils.h"
  
! #define PROGNAME "check_ups"
  #define REVISION "$Revision$"
  #define COPYRIGHT "1999-2002"
--- 57,61 ----
  #include "utils.h"
  
! const char *progname = "check_ups";
  #define REVISION "$Revision$"
  #define COPYRIGHT "1999-2002"
***************
*** 65,69 ****
  #define CHECK_NONE	0
  
! #define PORT	3305
  
  #define UPS_NONE     0   /* no supported options */
--- 65,69 ----
  #define CHECK_NONE	0
  
! #define PORT     3493
  
  #define UPS_NONE     0   /* no supported options */
***************
*** 536,540 ****
  			break;
  		case 'V':									/* version */
! 			print_revision (PROGNAME, "$Revision$");
  			exit (STATE_OK);
  		case 'h':									/* help */
--- 536,540 ----
  			break;
  		case 'V':									/* version */
! 			print_revision (progname, "$Revision$");
  			exit (STATE_OK);
  		case 'h':									/* help */
***************
*** 572,576 ****
  print_help (void)
  {
! 	print_revision (PROGNAME, "$Revision$");
  	printf
  		("Copyright (c) 2000 Tom Shields/Karl DeBisschop\n\n"
--- 572,576 ----
  print_help (void)
  {
! 	print_revision (progname, "$Revision$");
  	printf
  		("Copyright (c) 2000 Tom Shields/Karl DeBisschop\n\n"
***************
*** 612,615 ****
  		 "            [-t timeout] [-v]\n"
  		 "       %s --help\n"
! 		 "       %s --version\n", PROGNAME, PROGNAME, PROGNAME);
  }
--- 612,615 ----
  		 "            [-t timeout] [-v]\n"
  		 "       %s --help\n"
! 		 "       %s --version\n", progname, progname, progname);
  }

Index: check_users.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_users.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** check_users.c	9 Nov 2002 11:37:14 -0000	1.2
--- check_users.c	13 Jan 2003 12:15:16 -0000	1.3
***************
*** 49,53 ****
  #include "utils.h"
  
! #define PROGNAME "check_users"
  #define REVISION "$Revision$"
  #define COPYRIGHT "1999-2002"
--- 49,53 ----
  #include "utils.h"
  
! const char *progname = "check_users";
  #define REVISION "$Revision$"
  #define COPYRIGHT "1999-2002"
***************
*** 163,167 ****
  		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);
--- 163,167 ----
  		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);
***************
*** 170,174 ****
  			exit (STATE_OK);
  		case 'V':									/* version */
! 			print_revision (PROGNAME, REVISION);
  			exit (STATE_OK);
  		case 'c':									/* critical */
--- 170,174 ----
  			exit (STATE_OK);
  		case 'V':									/* version */
! 			print_revision (progname, REVISION);
  			exit (STATE_OK);
  		case 'c':									/* critical */
***************
*** 208,212 ****
  print_usage (void)
  {
! 	printf ("Usage: %s -w <users> -c <users>\n", PROGNAME);
  }
  
--- 208,212 ----
  print_usage (void)
  {
! 	printf ("Usage: %s -w <users> -c <users>\n", progname);
  }
  
***************
*** 218,222 ****
  print_help (void)
  {
! 	print_revision (PROGNAME, REVISION);
  	printf
  		("Copyright (c) " COPYRIGHT " " AUTHOR "(" EMAIL ")\n\n"
--- 218,222 ----
  print_help (void)
  {
! 	print_revision (progname, REVISION);
  	printf
  		("Copyright (c) " COPYRIGHT " " AUTHOR "(" EMAIL ")\n\n"

Index: check_vsz.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_vsz.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** check_vsz.c	13 Nov 2002 11:50:54 -0000	1.4
--- check_vsz.c	13 Jan 2003 12:15:16 -0000	1.5
***************
*** 34,38 ****
   *****************************************************************************/
  
! #define PROGNAME "check_vsz"
  #define REVISION "$Revision$"
  #define COPYRIGHT "1999-2002"
--- 34,38 ----
   *****************************************************************************/
  
! const char *progname = "check_vsz";
  #define REVISION "$Revision$"
  #define COPYRIGHT "1999-2002"
***************
*** 46,51 ****
  
  int process_arguments (int argc, char **argv);
! void print_help (char *cmd);
! void print_usage (char *cmd);
  
  int warn = -1;
--- 46,51 ----
  
  int process_arguments (int argc, char **argv);
! void print_help (const char *cmd);
! void print_usage (const char *cmd);
  
  int warn = -1;
***************
*** 65,70 ****
  
  	if (!process_arguments (argc, argv)) {
! 		printf ("%s: failure parsing arguments\n", my_basename (argv[0]));
! 		print_help (my_basename (argv[0]));
  		return STATE_UNKNOWN;
  	}
--- 65,70 ----
  
  	if (!process_arguments (argc, argv)) {
! 		printf ("%s: failure parsing arguments\n", progname);
! 		print_help (progname);
  		return STATE_UNKNOWN;
  	}
***************
*** 167,184 ****
  		switch (c) {
  		case '?':									/* help */
! 			printf ("%s: Unknown argument: %s\n\n", my_basename (argv[0]), optarg);
! 			print_usage (my_basename (argv[0]));
  			exit (STATE_UNKNOWN);
  		case 'h':									/* help */
! 			print_help (my_basename (argv[0]));
  			exit (STATE_OK);
  		case 'V':									/* version */
! 			print_revision (my_basename (argv[0]), "$Revision$");
  			exit (STATE_OK);
  		case 'c':									/* critical threshold */
  			if (!is_intnonneg (optarg)) {
  				printf ("%s: critical threshold must be an integer: %s\n",
! 								my_basename (argv[0]), optarg);
! 				print_usage (my_basename (argv[0]));
  				exit (STATE_UNKNOWN);
  			}
--- 167,184 ----
  		switch (c) {
  		case '?':									/* help */
! 			printf ("%s: Unknown argument: %s\n\n", progname, optarg);
! 			print_usage (progname);
  			exit (STATE_UNKNOWN);
  		case 'h':									/* help */
! 			print_help (progname);
  			exit (STATE_OK);
  		case 'V':									/* version */
! 			print_revision (progname, "$Revision$");
  			exit (STATE_OK);
  		case 'c':									/* critical threshold */
  			if (!is_intnonneg (optarg)) {
  				printf ("%s: critical threshold must be an integer: %s\n",
! 								progname, optarg);
! 				print_usage (progname);
  				exit (STATE_UNKNOWN);
  			}
***************
*** 188,193 ****
  			if (!is_intnonneg (optarg)) {
  				printf ("%s: warning threshold must be an integer: %s\n",
! 								my_basename (argv[0]), optarg);
! 				print_usage (my_basename (argv[0]));
  				exit (STATE_UNKNOWN);
  			}
--- 188,193 ----
  			if (!is_intnonneg (optarg)) {
  				printf ("%s: warning threshold must be an integer: %s\n",
! 								progname, optarg);
! 				print_usage (progname);
  				exit (STATE_UNKNOWN);
  			}
***************
*** 204,209 ****
  		if (!is_intnonneg (argv[c])) {
  			printf ("%s: critical threshold must be an integer: %s\n",
! 							PROGNAME, argv[c]);
! 			print_usage (PROGNAME);
  			exit (STATE_UNKNOWN);
  		}
--- 204,209 ----
  		if (!is_intnonneg (argv[c])) {
  			printf ("%s: critical threshold must be an integer: %s\n",
! 							progname, argv[c]);
! 			print_usage (progname);
  			exit (STATE_UNKNOWN);
  		}
***************
*** 214,219 ****
  		if (!is_intnonneg (argv[c])) {
  			printf ("%s: critical threshold must be an integer: %s\n",
! 							PROGNAME, argv[c]);
! 			print_usage (PROGNAME);
  			exit (STATE_UNKNOWN);
  		}
--- 214,219 ----
  		if (!is_intnonneg (argv[c])) {
  			printf ("%s: critical threshold must be an integer: %s\n",
! 							progname, argv[c]);
! 			print_usage (progname);
  			exit (STATE_UNKNOWN);
  		}
***************
*** 228,232 ****
  
  void
! print_usage (char *cmd)
  {
  	printf ("Usage: %s -w <wsize> -c <csize> [-C command]\n"
--- 228,232 ----
  
  void
! print_usage (const char *cmd)
  {
  	printf ("Usage: %s -w <wsize> -c <csize> [-C command]\n"
***************
*** 235,239 ****
  
  void
! print_help (char *cmd)
  {
  	print_revision ("check_vsz", "$Revision$");
--- 235,239 ----
  
  void
! print_help (const char *cmd)
  {
  	print_revision ("check_vsz", "$Revision$");

Index: negate.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/negate.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** negate.c	9 Nov 2002 03:39:35 -0000	1.3
--- negate.c	13 Jan 2003 12:15:16 -0000	1.4
***************
*** 24,28 ****
   *****************************************************************************/
  
! #define PROGNAME "negate"
  #define REVISION "$Revision$"
  #define COPYRIGHT "2002"
--- 24,28 ----
   *****************************************************************************/
  
! const char *progname = "negate";
  #define REVISION "$Revision$"
  #define COPYRIGHT "2002"
***************
*** 53,60 ****
  char *command_line;
  
! static int process_arguments (int, char **);
! static int validate_arguments (void);
! static void print_usage (void);
! static void print_help (void);
  
  /******************************************************************************
--- 53,60 ----
  char *command_line;
  
! int process_arguments (int, char **);
! int validate_arguments (void);
! void print_usage (void);
! void print_help (void);
  
  /******************************************************************************
***************
*** 77,81 ****
  </refmeta>
  <refnamdiv>
! <refname>&PROGNAME;</refname>
  <refpurpose>&SUMMARY;</refpurpose>
  </refnamdiv>
--- 77,81 ----
  </refmeta>
  <refnamdiv>
! <refname>&progname;</refname>
  <refpurpose>&SUMMARY;</refpurpose>
  </refnamdiv>
***************
*** 175,179 ****
  print_help (void)
  {
! 	print_revision (PROGNAME, REVISION);
  	printf
  		("Copyright (c) %s %s <%s>\n\n%s\n",
--- 175,179 ----
  print_help (void)
  {
! 	print_revision (progname, REVISION);
  	printf
  		("Copyright (c) %s %s <%s>\n\n%s\n",
***************
*** 197,201 ****
  					" %s -V for version information\n",
  #endif
! 					PROGNAME, OPTIONS, PROGNAME, PROGNAME);
  }
  
--- 197,201 ----
  					" %s -V for version information\n",
  #endif
! 					progname, OPTIONS, progname, progname);
  }
  
***************
*** 250,254 ****
  			exit (EXIT_SUCCESS);
  		case 'V':     /* version */
! 			print_revision (PROGNAME, REVISION);
  			exit (EXIT_SUCCESS);
  		case 't':     /* timeout period */
--- 250,254 ----
  			exit (EXIT_SUCCESS);
  		case 'V':     /* version */
! 			print_revision (progname, REVISION);
  			exit (EXIT_SUCCESS);
  		case 't':     /* timeout period */

Index: urlize.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/urlize.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** urlize.c	13 Nov 2002 11:50:54 -0000	1.4
--- urlize.c	13 Jan 2003 12:15:16 -0000	1.5
***************
*** 38,47 ****
   *****************************************************************************/
  
  #include "common.h"
  #include "utils.h"
  #include "popen.h"
  
! void print_usage (char *);
! void print_help (char *);
  
  int
--- 38,49 ----
   *****************************************************************************/
  
+ const char *progname = "urlize";
+ 
  #include "common.h"
  #include "utils.h"
  #include "popen.h"
  
! void print_usage (const char *);
! void print_help (const char *);
  
  int
***************
*** 53,57 ****
  
  	if (argc < 2) {
! 		print_usage (my_basename (argv[0]));
  		exit (STATE_UNKNOWN);
  	}
--- 55,59 ----
  
  	if (argc < 2) {
! 		print_usage (progname);
  		exit (STATE_UNKNOWN);
  	}
***************
*** 63,72 ****
  
  	if (!strcmp (argv[1], "-V") || !strcmp (argv[1], "--version")) {
! 		print_revision (my_basename (argv[0]), "$Revision$");
  		exit (STATE_OK);
  	}
  
  	if (argc < 2) {
! 		print_usage (my_basename (argv[0]));
  		exit (STATE_UNKNOWN);
  	}
--- 65,74 ----
  
  	if (!strcmp (argv[1], "-V") || !strcmp (argv[1], "--version")) {
! 		print_revision (progname, "$Revision$");
  		exit (STATE_OK);
  	}
  
  	if (argc < 2) {
! 		print_usage (progname);
  		exit (STATE_UNKNOWN);
  	}
***************
*** 121,134 ****
  
  void
! print_usage (char *cmd)
  {
! 	printf ("Usage:\n %s <url> <plugin> <arg1> ... <argN>\n",
! 					my_basename (cmd));
  }
  
  void
! print_help (char *cmd)
  {
! 	print_revision ("urlize", "$Revision$");
  	printf
  		("Copyright (c) 2000 Karl DeBisschop (kdebiss at alum.mit.edu)\n\n"
--- 123,135 ----
  
  void
! print_usage (const char *cmd)
  {
! 	printf ("Usage:\n %s <url> <plugin> <arg1> ... <argN>\n",	cmd);
  }
  
  void
! print_help (const char *cmd)
  {
! 	print_revision (progname, "$Revision$");
  	printf
  		("Copyright (c) 2000 Karl DeBisschop (kdebiss at alum.mit.edu)\n\n"

Index: utils.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/utils.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** utils.c	3 Jan 2003 03:24:17 -0000	1.14
--- utils.c	13 Jan 2003 12:15:16 -0000	1.15
***************
*** 19,27 ****
  
  extern int timeout_interval;
  
- char *my_basename (char *);
  void support (void);
  char *clean_revstring (const char *);
! void print_revision (char *, const char *);
  void terminate (int, const char *fmt, ...);
  RETSIGTYPE timeout_alarm_handler (int);
--- 19,27 ----
  
  extern int timeout_interval;
+ extern const char *progname;
  
  void support (void);
  char *clean_revstring (const char *);
! void print_revision (const char *, const char *);
  void terminate (int, const char *fmt, ...);
  RETSIGTYPE timeout_alarm_handler (int);
***************
*** 58,63 ****
  #define TXTBLK 128
  
- #define max(a,b) ((a)>(b))?(a):(b)
- 
  /* **************************************************************************
   * max_state(STATE_x, STATE_y)
--- 58,61 ----
***************
*** 69,73 ****
  
  int
! max_state(int a, int b)
  {
  	if (a == STATE_CRITICAL || b == STATE_CRITICAL)
--- 67,71 ----
  
  int
! max_state (int a, int b)
  {
  	if (a == STATE_CRITICAL || b == STATE_CRITICAL)
***************
*** 85,95 ****
  }
  
! char *
! my_basename (char *path)
  {
! 	if (!strstr (path, "/"))
! 		return path;
! 	else
! 		return 1 + strrchr (path, '/');
  }
  
--- 83,106 ----
  }
  
! void usage (char *msg)
  {
! 	printf (msg);
! 	print_usage ();
! 	exit (STATE_UNKNOWN);
! }
! 
! void usage2(char *msg, char *arg)
! {
! 	printf ("%s: %s - %s\n",progname,msg,arg);
! 	print_usage ();
! 	exit (STATE_UNKNOWN);
! }
! 
! void
! usage3 (char *msg, char arg)
! {
! 	printf ("%s: %s - %c\n", progname, msg, arg);
! 	print_usage();
! 	exit (STATE_UNKNOWN);
  }
  
***************
*** 116,120 ****
  
  void
! print_revision (char *command_name, const char *revision_string)
  {
  	char plugin_revision[STRLEN];
--- 127,131 ----
  
  void
! print_revision (const char *command_name, const char *revision_string)
  {
  	char plugin_revision[STRLEN];
***************
*** 123,127 ****
  		strncpy (plugin_revision, "N/A", STRLEN);
  	printf ("%s (nagios-plugins %s) %s\n",
! 					my_basename (command_name), VERSION, plugin_revision);
  	printf
  		("The nagios plugins come with ABSOLUTELY NO WARRANTY. You may redistribute\n"
--- 134,138 ----
  		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"

Index: utils.h.in
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/utils.h.in,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** utils.h.in	9 Nov 2002 03:39:35 -0000	1.7
--- utils.h.in	13 Jan 2003 12:15:16 -0000	1.8
***************
*** 17,21 ****
  void support (void);
  char *clean_revstring (const char *revstring);
! void print_revision (char *, const char *);
  void terminate (int result, char *msg, ...);
  extern RETSIGTYPE timeout_alarm_handler (int);
--- 17,21 ----
  void support (void);
  char *clean_revstring (const char *revstring);
! void print_revision (const char *, const char *);
  void terminate (int result, char *msg, ...);
  extern RETSIGTYPE timeout_alarm_handler (int);
***************
*** 70,95 ****
  char *strpcat (char *dest, const char *src, const char *str);
  
! /* Handle comparisions for STATE_* */
! int max_state(int, int);
  
! #define max(a,b) ((a)>(b))?(a):(b)
  
! #define usage(msg) {\
!  printf(msg);\
!  print_usage();\
!  exit(STATE_UNKNOWN);\
! }
! 
! #define usage2(msg,arg) {\
!  printf("%s: %s - %s\n",PROGNAME,msg,arg);\
!  print_usage();\
!  exit(STATE_UNKNOWN);\
! }
! 
! #define usage3(msg,arg) {\
!  printf("%s: %s - %c\n",PROGNAME,msg,arg);\
!  print_usage();\
!  exit(STATE_UNKNOWN);\
! }
  
  #define state_text(a) \
--- 70,81 ----
  char *strpcat (char *dest, const char *src, const char *str);
  
! int max_state (int a, int b);
  
! void usage (char *msg);
! void usage2(char *msg, char *arg);
! void usage3(char *msg, char arg);
  
! 
! #define max(a,b) (((a)>(b))?(a):(b))
  
  #define state_text(a) \





More information about the Commits mailing list