[Nagiosplug-checkins] CVS: nagiosplug/plugins check_dns.c,1.12,1.13 check_http.c,1.28,1.29 check_tcp.c,1.17,1.18

Ton Voon tonvoon at users.sourceforge.net
Thu Mar 13 13:15:10 CET 2003


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

Modified Files:
	check_dns.c check_http.c check_tcp.c 
Log Message:
Strip leading spaces in perf data


Index: check_dns.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_dns.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** check_dns.c	12 Mar 2003 00:45:01 -0000	1.12
--- check_dns.c	13 Mar 2003 21:14:25 -0000	1.13
***************
*** 194,198 ****
  			multi_address = TRUE;
  
! 		printf ("DNS ok - %-5.3f seconds response time, address%s %s|time=%-5.3f\n",
  		  elapsed_time, (multi_address==TRUE ? "es are" : " is"), address, elapsed_time);
  	}
--- 194,198 ----
  			multi_address = TRUE;
  
! 		printf ("DNS ok - %.3f seconds response time, address%s %s|time=%.3f\n",
  		  elapsed_time, (multi_address==TRUE ? "es are" : " is"), address, elapsed_time);
  	}

Index: check_http.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_http.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -r1.28 -r1.29
*** check_http.c	12 Mar 2003 02:29:15 -0000	1.28
--- check_http.c	13 Mar 2003 21:14:25 -0000	1.29
***************
*** 796,800 ****
  				printf ("CRITICAL");
  			elapsed_time = delta_time (tv);
! 			asprintf (&msg, " - %s - %7.3f second response time %s%s|time=%7.3f\n",
  		                 status_line, elapsed_time, timestamp,
  	                   (display_html ? "</A>" : ""), elapsed_time);
--- 796,800 ----
  				printf ("CRITICAL");
  			elapsed_time = delta_time (tv);
! 			asprintf (&msg, " - %s - %.3f second response time %s%s|time=%.3f\n",
  		                 status_line, elapsed_time, timestamp,
  	                   (display_html ? "</A>" : ""), elapsed_time);
***************
*** 808,812 ****
  	/* check elapsed time */
  	elapsed_time = delta_time (tv);
! 	asprintf (&msg, "HTTP problem: %s - %7.3f second response time %s%s|time=%7.3f\n",
  	               status_line, elapsed_time, timestamp,
  	               (display_html ? "</A>" : ""), elapsed_time);
--- 808,812 ----
  	/* check elapsed time */
  	elapsed_time = delta_time (tv);
! 	asprintf (&msg, "HTTP problem: %s - %.3f second response time %s%s|time=%.3f\n",
  	               status_line, elapsed_time, timestamp,
  	               (display_html ? "</A>" : ""), elapsed_time);
***************
*** 821,825 ****
  	if (strlen (string_expect)) {
  		if (strstr (page, string_expect)) {
! 			printf ("HTTP OK %s - %7.3f second response time %s%s|time=%7.3f\n",
  			        status_line, elapsed_time,
  			        timestamp, (display_html ? "</A>" : ""), elapsed_time);
--- 821,825 ----
  	if (strlen (string_expect)) {
  		if (strstr (page, string_expect)) {
! 			printf ("HTTP OK %s - %.3f second response time %s%s|time=%.3f\n",
  			        status_line, elapsed_time,
  			        timestamp, (display_html ? "</A>" : ""), elapsed_time);
***************
*** 827,831 ****
  		}
  		else {
! 			printf ("CRITICAL - string not found%s|time=%7.3f\n",
  			        (display_html ? "</A>" : ""), elapsed_time);
  			exit (STATE_CRITICAL);
--- 827,831 ----
  		}
  		else {
! 			printf ("CRITICAL - string not found%s|time=%.3f\n",
  			        (display_html ? "</A>" : ""), elapsed_time);
  			exit (STATE_CRITICAL);
***************
*** 836,840 ****
  		errcode = regexec (&preg, page, REGS, pmatch, 0);
  		if (errcode == 0) {
! 			printf ("HTTP OK %s - %7.3f second response time %s%s|time=%7.3f\n",
  			        status_line, elapsed_time,
  			        timestamp, (display_html ? "</A>" : ""), elapsed_time);
--- 836,840 ----
  		errcode = regexec (&preg, page, REGS, pmatch, 0);
  		if (errcode == 0) {
! 			printf ("HTTP OK %s - %.3f second response time %s%s|time=%.3f\n",
  			        status_line, elapsed_time,
  			        timestamp, (display_html ? "</A>" : ""), elapsed_time);
***************
*** 843,847 ****
  		else {
  			if (errcode == REG_NOMATCH) {
! 				printf ("CRITICAL - pattern not found%s|time=%7.3f\n",
  				        (display_html ? "</A>" : ""), elapsed_time);
  				exit (STATE_CRITICAL);
--- 843,847 ----
  		else {
  			if (errcode == REG_NOMATCH) {
! 				printf ("CRITICAL - pattern not found%s|time=%.3f\n",
  				        (display_html ? "</A>" : ""), elapsed_time);
  				exit (STATE_CRITICAL);
***************
*** 864,868 ****
  	}
  	/* We only get here if all tests have been passed */
! 	asprintf (&msg, "HTTP OK %s - %7.3f second response time %s%s|time=%7.3f\n",
  	                status_line, (float)elapsed_time,
  	                timestamp, (display_html ? "</A>" : ""), elapsed_time);
--- 864,868 ----
  	}
  	/* We only get here if all tests have been passed */
! 	asprintf (&msg, "HTTP OK %s - %.3f second response time %s%s|time=%.3f\n",
  	                status_line, (float)elapsed_time,
  	                timestamp, (display_html ? "</A>" : ""), elapsed_time);

Index: check_tcp.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_tcp.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -r1.17 -r1.18
*** check_tcp.c	13 Mar 2003 20:33:18 -0000	1.17
--- check_tcp.c	13 Mar 2003 21:14:26 -0000	1.18
***************
*** 338,342 ****
  
  	printf
! 		("%s %s - %7.3f second response time on port %d",
  		 SERVICE,
  		 state_text (result), elapsed_time, server_port);
--- 338,342 ----
  
  	printf
! 		("%s %s - %.3f second response time on port %d",
  		 SERVICE,
  		 state_text (result), elapsed_time, server_port);
***************
*** 345,349 ****
  		printf (" [%s]", status);
  
! 	printf ("|time=%7.3f\n", elapsed_time);
  
  	return result;
--- 345,349 ----
  		printf (" [%s]", status);
  
! 	printf ("|time=%.3f\n", elapsed_time);
  
  	return result;





More information about the Commits mailing list