[Nagiosplug-checkins] CVS: nagiosplug/plugins check_by_ssh.c,1.12,1.13 check_dig.c,1.13,1.14 check_disk.c,1.28,1.29 check_dns.c,1.17,1.18 check_dummy.c,1.3,1.4 check_pgsql.c,1.12,1.13 check_swap.c,1.14,1.15 check_tcp.c,1.30,1.31 utils.h,1.6,1.7

Karl DeBisschop kdebisschop at users.sourceforge.net
Sat Aug 2 09:43:03 CEST 2003


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

Modified Files:
	check_by_ssh.c check_dig.c check_disk.c check_dns.c 
	check_dummy.c check_pgsql.c check_swap.c check_tcp.c utils.h 
Log Message:
establish "UT_" namespace for usage text in #defines

Index: check_by_ssh.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_by_ssh.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** check_by_ssh.c	30 Jul 2003 11:39:37 -0000	1.12
--- check_by_ssh.c	2 Aug 2003 16:42:57 -0000	1.13
***************
*** 50,58 ****
  	print_usage ();
  
! 	printf (_(HELP_VRSN));
  
! 	printf (_(HOST_PORT), 'p', "none");
  
! 	printf (_(IPv46));
  
  	printf (_("\
--- 50,58 ----
  	print_usage ();
  
! 	printf (_(UT_HELP_VRSN));
  
! 	printf (_(UT_HOST_PORT), 'p', "none");
  
! 	printf (_(UT_IPv46));
  
  	printf (_("\
***************
*** 78,82 ****
      short name of host in nagios configuration [optional]\n"));
  
! 	printf (_(WARN_CRIT_TO), DEFAULT_SOCKET_TIMEOUT);
  
  	printf (_("\n\
--- 78,84 ----
      short name of host in nagios configuration [optional]\n"));
  
! 	printf (_(UT_WARN_CRIT));
! 
! 	printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT);
  
  	printf (_("\n\

Index: check_dig.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_dig.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -r1.13 -r1.14
*** check_dig.c	30 Jul 2003 04:07:53 -0000	1.13
--- check_dig.c	2 Aug 2003 16:42:57 -0000	1.14
***************
*** 63,69 ****
  	print_usage ();
  
! 	printf (_(HELP_VRSN));
  
! 	printf (_(HOST_PORT), 'P', myport);
  
  	printf (_("\
--- 63,69 ----
  	print_usage ();
  
! 	printf (_(UT_HELP_VRSN));
  
! 	printf (_(UT_HOST_PORT), 'P', myport);
  
  	printf (_("\
***************
*** 71,77 ****
     machine name to lookup\n"));
  
! 	printf (_(WARN_CRIT_TO), DEFAULT_SOCKET_TIMEOUT);
  
! 	printf (_(VRBS));
  
  	support ();
--- 71,79 ----
     machine name to lookup\n"));
  
! 	printf (_(UT_WARN_CRIT));
  
! 	printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT);
! 
! 	printf (_(UT_VERBOSE));
  
  	support ();

Index: check_disk.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_disk.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -r1.28 -r1.29
*** check_disk.c	31 Jul 2003 11:02:43 -0000	1.28
--- check_disk.c	2 Aug 2003 16:42:57 -0000	1.29
***************
*** 60,64 ****
  	print_usage ();
  
! 	printf (_(HELP_VRSN));
  
  	printf (_("\
--- 60,64 ----
  	print_usage ();
  
! 	printf (_(UT_HELP_VRSN));
  
  	printf (_("\
***************
*** 96,102 ****
      Display only devices/mountpoints with errors\n"));
  
! 	printf (_(TIMEOUT), DEFAULT_SOCKET_TIMEOUT);
  
! 	printf (_(VRBS));
  
  	printf ("%s", _("Examples:\n\
--- 96,104 ----
      Display only devices/mountpoints with errors\n"));
  
! 	printf (_(UT_WARN_CRIT));
  
! 	printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT);
! 
! 	printf (_(UT_VERBOSE));
  
  	printf ("%s", _("Examples:\n\

Index: check_dns.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_dns.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -r1.17 -r1.18
*** check_dns.c	1 Aug 2003 23:56:03 -0000	1.17
--- check_dns.c	2 Aug 2003 16:42:57 -0000	1.18
***************
*** 74,78 ****
  	print_usage ();
  
! 	printf (_(HELP_VRSN));
  
  	printf (_("\
--- 74,78 ----
  	print_usage ();
  
! 	printf (_(UT_HELP_VRSN));
  
  	printf (_("\
***************
*** 84,88 ****
     Optional IP address you expect the DNS server to return\n"));
  
! 	printf (_(TIMEOUT), DEFAULT_SOCKET_TIMEOUT);
  
  	printf (_("\n\
--- 84,88 ----
     Optional IP address you expect the DNS server to return\n"));
  
! 	printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT);
  
  	printf (_("\n\
***************
*** 156,162 ****
  		if (strstr (input_buffer, ".in-addr.arpa")) {
  			if ((temp_buffer = strstr (input_buffer, "name = ")))
! 				address = strscpy (address, temp_buffer + 7);
  			else {
! 				output = strscpy (output, _("Unknown error (plugin)"));
  				result = STATE_WARNING;
  			}
--- 156,162 ----
  		if (strstr (input_buffer, ".in-addr.arpa")) {
  			if ((temp_buffer = strstr (input_buffer, "name = ")))
! 				address = strdup (temp_buffer + 7);
  			else {
! 				output = strdup (_("Unknown error (plugin)"));
  				result = STATE_WARNING;
  			}
***************
*** 196,200 ****
  		result = error_scan (input_buffer);
  		if (result != STATE_OK) {
! 			output = strscpy (output, 1 + index (input_buffer, ':'));
  			strip (output);
  			break;
--- 196,200 ----
  		result = error_scan (input_buffer);
  		if (result != STATE_OK) {
! 			output = strdup (1 + index (input_buffer, ':'));
  			strip (output);
  			break;
***************
*** 207,211 ****
  		if (error_scan (input_buffer) != STATE_OK) {
  			result = max_state (result, error_scan (input_buffer));
! 			output = strscpy (output, 1 + index (input_buffer, ':'));
  			strip (output);
  		}
--- 207,211 ----
  		if (error_scan (input_buffer) != STATE_OK) {
  			result = max_state (result, error_scan (input_buffer));
! 			output = strdup (1 + index (input_buffer, ':'));
  			strip (output);
  		}
***************
*** 219,223 ****
  		result = max_state (result, STATE_WARNING);
  		if (!strcmp (output, ""))
! 			output = strscpy (output, _("nslookup returned error status"));
  	}
  
--- 219,223 ----
  		result = max_state (result, STATE_WARNING);
  		if (!strcmp (output, ""))
! 			output = strdup (_("nslookup returned error status"));
  	}
  
***************
*** 269,283 ****
  		return STATE_OK;
  
- 	/* the DNS lookup timed out */
- 	else if (strstr (input_buffer, "Timed out"))
- 		terminate (STATE_WARNING, "Request timed out at server\n");
- 
  	/* DNS server is not running... */
  	else if (strstr (input_buffer, "No response from server"))
! 		terminate (STATE_CRITICAL, "No response from name server %s\n", dns_server);
  
  	/* Host name is valid, but server doesn't have records... */
  	else if (strstr (input_buffer, "No records"))
! 		terminate (STATE_CRITICAL, "Name server %s has no records\n", dns_server);
  
  	/* Connection was refused */
--- 269,279 ----
  		return STATE_OK;
  
  	/* DNS server is not running... */
  	else if (strstr (input_buffer, "No response from server"))
! 		terminate (STATE_CRITICAL, _("No response from name server %s\n"), dns_server);
  
  	/* Host name is valid, but server doesn't have records... */
  	else if (strstr (input_buffer, "No records"))
! 		terminate (STATE_CRITICAL, _("Name server %s has no records\n"), dns_server);
  
  	/* Connection was refused */
***************
*** 286,290 ****
  	          strstr (input_buffer, ": REFUSED")) ||
  	         (strstr (input_buffer, "Refused")))
! 		terminate (STATE_CRITICAL, "Connection to name server %s was refused\n", dns_server);
  
  	/* Host or domain name does not exist */
--- 282,286 ----
  	          strstr (input_buffer, ": REFUSED")) ||
  	         (strstr (input_buffer, "Refused")))
! 		terminate (STATE_CRITICAL, _("Connection to name server %s was refused\n"), dns_server);
  
  	/* Host or domain name does not exist */
***************
*** 292,308 ****
  	         strstr (input_buffer, "** server can't find") ||
  	         strstr (input_buffer,"NXDOMAIN"))
! 		terminate (STATE_CRITICAL, "Domain %s was not found by the server\n", query_address);
  
  	/* Network is unreachable */
  	else if (strstr (input_buffer, "Network is unreachable"))
! 		terminate (STATE_CRITICAL, "Network is unreachable\n");
  
  	/* Internal server failure */
  	else if (strstr (input_buffer, "Server failure"))
! 		terminate (STATE_CRITICAL, "Server failure for %s\n", dns_server);
  
! 	/* Request error */
! 	else if (strstr (input_buffer, "Format error"))
! 		terminate (STATE_WARNING, "Format error\n");
  
  	return STATE_OK;
--- 288,305 ----
  	         strstr (input_buffer, "** server can't find") ||
  	         strstr (input_buffer,"NXDOMAIN"))
! 		terminate (STATE_CRITICAL, _("Domain %s was not found by the server\n"), query_address);
  
  	/* Network is unreachable */
  	else if (strstr (input_buffer, "Network is unreachable"))
! 		terminate (STATE_CRITICAL, _("Network is unreachable\n"));
  
  	/* Internal server failure */
  	else if (strstr (input_buffer, "Server failure"))
! 		terminate (STATE_CRITICAL, _("Server failure for %s\n"), dns_server);
  
! 	/* Request error or the DNS lookup timed out */
! 	else if (strstr (input_buffer, "Format error") ||
! 	         strstr (input_buffer, "Timed out"))
! 		return STATE_WARNING;
  
  	return STATE_OK;

Index: check_dummy.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_dummy.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** check_dummy.c	1 Aug 2003 06:04:01 -0000	1.3
--- check_dummy.c	2 Aug 2003 16:42:57 -0000	1.4
***************
*** 58,66 ****
  	print_usage ();
  
! 	printf (_(HELP_VRSN));
  
  	printf (_("\n\
  This plugin will simply return the state corresponding to the numeric value\n\
  of the <state> argument.\n"));
  }
  
--- 58,68 ----
  	print_usage ();
  
! 	printf (_(UT_HELP_VRSN));
  
  	printf (_("\n\
  This plugin will simply return the state corresponding to the numeric value\n\
  of the <state> argument.\n"));
+ 
+ 	support ();
  }
  

Index: check_pgsql.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_pgsql.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** check_pgsql.c	30 Jul 2003 04:07:53 -0000	1.12
--- check_pgsql.c	2 Aug 2003 16:42:57 -0000	1.13
***************
*** 137,145 ****
  	print_usage ();
  
! 	printf (_(HELP_VRSN));
  
! 	printf (_(HOST_PORT), 'P', myport);
  
! 	printf (_(IPv46));
  
  	printf (S_("\
--- 137,145 ----
  	print_usage ();
  
! 	printf (_(UT_HELP_VRSN));
  
! 	printf (_(UT_HOST_PORT), 'P', myport);
  
! 	printf (_(UT_IPv46));
  
  	printf (S_("\
***************
*** 151,157 ****
      Password (BIG SECURITY ISSUE)\n"), DEFAULT_DB);
  
! 	printf (_(WARN_CRIT_TO), DEFAULT_SOCKET_TIMEOUT);
  
! 	printf (_(VRBS));
  
  	printf (S_("\nAll parameters are optional.\n\
--- 151,159 ----
      Password (BIG SECURITY ISSUE)\n"), DEFAULT_DB);
  
! 	printf (_(UT_WARN_CRIT));
  
! 	printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT);
! 
! 	printf (_(UT_VERBOSE));
  
  	printf (S_("\nAll parameters are optional.\n\

Index: check_swap.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_swap.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** check_swap.c	30 Jul 2003 04:07:53 -0000	1.14
--- check_swap.c	2 Aug 2003 16:42:57 -0000	1.15
***************
*** 78,82 ****
  	print_usage ();
  
! 	printf (_(HELP_VRSN));
  
  	printf (_("\n\
--- 78,82 ----
  	print_usage ();
  
! 	printf (_(UT_HELP_VRSN));
  
  	printf (_("\n\

Index: check_tcp.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_tcp.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -r1.30 -r1.31
*** check_tcp.c	30 Jul 2003 04:07:53 -0000	1.30
--- check_tcp.c	2 Aug 2003 16:42:57 -0000	1.31
***************
*** 99,105 ****
  	printf (_("\
  Usage: %s -H host -p port [-w <warning time>] [-c <critical time>]\n\
! 	[-s <send string>] [-e <expect string>] [-q <quit string>]\n\
! 	[-m <maximum bytes>] [-d <delay>] [-t <timeout seconds>]\n\
! 	[-r <refuse state>] [-v] [-4|-6]\n"), progname);
  	printf ("       %s (-h|--help)\n", progname);
  	printf ("       %s (-V|--version)\n", progname);
--- 99,105 ----
  	printf (_("\
  Usage: %s -H host -p port [-w <warning time>] [-c <critical time>]\n\
!   [-s <send string>] [-e <expect string>] [-q <quit string>]\n\
!   [-m <maximum bytes>] [-d <delay>] [-t <timeout seconds>]\n\
!   [-r <refuse state>] [-v] [-4|-6]\n"), progname);
  	printf ("       %s (-h|--help)\n", progname);
  	printf ("       %s (-V|--version)\n", progname);
***************
*** 117,125 ****
  	print_usage ();
  
! 	printf (_(HELP_VRSN));
  
! 	printf (_(HOST_PORT), 'p', "none");
  
! 	printf (_(IPv46));
  
  	printf (_("\
--- 117,125 ----
  	print_usage ();
  
! 	printf (_(UT_HELP_VRSN));
  
! 	printf (_(UT_HOST_PORT), 'p', "none");
  
! 	printf (_(UT_IPv46));
  
  	printf (_("\
***************
*** 139,145 ****
      Seconds to wait between sending string and polling for response\n"));
  
! 	printf (_(WARN_CRIT_TO), DEFAULT_SOCKET_TIMEOUT);
  
! 	printf (_(VRBS));
  
  	support ();
--- 139,147 ----
      Seconds to wait between sending string and polling for response\n"));
  
! 	printf (_(UT_WARN_CRIT));
  
! 	printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT);
! 
! 	printf (_(UT_VERBOSE));
  
  	support ();

Index: utils.h
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/utils.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** utils.h	31 Jul 2003 11:02:42 -0000	1.6
--- utils.h	2 Aug 2003 16:42:57 -0000	1.7
***************
*** 93,97 ****
  \t<%s>\n\n"
  
! #define HELP_VRSN "\
  \nOptions:\n\
   -h, --help\n\
--- 93,97 ----
  \t<%s>\n\n"
  
! #define UT_HELP_VRSN "\
  \nOptions:\n\
   -h, --help\n\
***************
*** 100,104 ****
      Print version information\n"
  
! #define HOST_PORT "\
   -H, --hostname=ADDRESS\n\
      Host name or IP Address\n\
--- 100,104 ----
      Print version information\n"
  
! #define UT_HOST_PORT "\
   -H, --hostname=ADDRESS\n\
      Host name or IP Address\n\
***************
*** 106,110 ****
      Port number (default: %s)\n"
  
! #define IPv46 "\
   -4, --use-ipv4\n\
      Use IPv4 connection\n\
--- 106,110 ----
      Port number (default: %s)\n"
  
! #define UT_IPv46 "\
   -4, --use-ipv4\n\
      Use IPv4 connection\n\
***************
*** 112,128 ****
      Use IPv6 connection\n"
  
! #define VRBS "\
   -v, --verbose\n\
      Show details for command-line debugging (Nagios may truncate output)\n"
  
! #define WARN_CRIT_TO "\
   -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"
  
! #define TIMEOUT "\
   -t, --timeout=INTEGER\n\
      Seconds before connection times out (default: %d)\n"
--- 112,126 ----
      Use IPv6 connection\n"
  
! #define UT_VERBOSE "\
   -v, --verbose\n\
      Show details for command-line debugging (Nagios may truncate output)\n"
  
! #define UT_WARN_CRIT "\
   -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"
  
! #define UT_TIMEOUT "\
   -t, --timeout=INTEGER\n\
      Seconds before connection times out (default: %d)\n"





More information about the Commits mailing list