[Nagiosplug-checkins] CVS: nagiosplug/plugins check_tcp.c,1.40,1.41

Ton Voon tonvoon at users.sourceforge.net
Wed Nov 17 15:36:05 CET 2004


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

Modified Files:
	check_tcp.c 
Log Message:
Ignore output from tcp port (949070 - Jan-Piet Mens)


Index: check_tcp.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_tcp.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -C2 -r1.40 -r1.41
*** check_tcp.c	14 Mar 2004 04:09:19 -0000	1.40
--- check_tcp.c	17 Nov 2004 23:35:08 -0000	1.41
***************
*** 85,88 ****
--- 85,89 ----
  double critical_time = 0;
  int check_critical_time = FALSE;
+ int hide_output = FALSE;
  double elapsed_time = 0;
  long microsec;
***************
*** 330,334 ****
  		 elapsed_time, server_port);
  
! 	if (status && strlen(status) > 0)
  		printf (" [%s]", status);
  
--- 331,335 ----
  		 elapsed_time, server_port);
  
! 	if (hide_output == FALSE && status && strlen(status) > 0)
  		printf (" [%s]", status);
  
***************
*** 365,368 ****
--- 366,370 ----
  		{"maxbytes", required_argument, 0, 'm'},
  		{"quit", required_argument, 0, 'q'},
+ 		{"jail", required_argument, 0, 'j'},
  		{"delay", required_argument, 0, 'd'},
  		{"refuse", required_argument, 0, 'r'},
***************
*** 396,400 ****
  
  	while (1) {
! 		c = getopt_long (argc, argv, "+hVv46H:s:e:q:m:c:w:t:p:C:W:d:Sr:",
  		                 longopts, &option);
  
--- 398,402 ----
  
  	while (1) {
! 		c = getopt_long (argc, argv, "+hVv46H:s:e:q:m:c:w:t:p:C:W:d:Sr:j",
  		                 longopts, &option);
  
***************
*** 438,441 ****
--- 440,446 ----
  			check_critical_time = TRUE;
  			break;
+ 		case 'j':		  /* hide output */
+ 			hide_output = TRUE;
+ 			break;
  		case 'w':                 /* warning */
  			if (!is_intnonneg (optarg))
***************
*** 623,626 ****
--- 628,633 ----
   -r, --refuse=ok|warn|crit\n\
      Accept tcp refusals with states ok, warn, crit (default: crit)\n\
+  -j, --jail\n\
+     Hide output from TCP socket\n\
   -m, --maxbytes=INTEGER\n\
      Close connection once more than this number of bytes are received\n\
***************
*** 647,651 ****
    [-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);
--- 654,658 ----
    [-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] [-j]\n"), progname);
  	printf ("       %s (-h|--help)\n", progname);
  	printf ("       %s (-V|--version)\n", progname);





More information about the Commits mailing list