[Nagiosplug-checkins] CVS: nagiosplug/plugins check_dns.c,1.20,1.21 check_smtp.c,1.18,1.19

Karl DeBisschop kdebisschop at users.sourceforge.net
Sun Aug 10 05:49:04 CEST 2003


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

Modified Files:
	check_dns.c check_smtp.c 
Log Message:
perf data in integer microseconds

Index: check_dns.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_dns.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -r1.20 -r1.21
*** check_dns.c	10 Aug 2003 06:53:21 -0000	1.20
--- check_dns.c	10 Aug 2003 12:48:47 -0000	1.21
***************
*** 79,82 ****
--- 79,83 ----
  	int result = STATE_UNKNOWN;
  	double elapsed_time;
+ 	long microsec;
  	struct timeval tv;
  	int multi_address;
***************
*** 198,203 ****
  		asprintf(&output, _("expected %s but got %s"), expected_address, address);
  	}
! 	
! 	elapsed_time = delta_time (tv);
  
  	if (result == STATE_OK) {
--- 199,205 ----
  		asprintf(&output, _("expected %s but got %s"), expected_address, address);
  	}
! 
! 	microsec = deltime (tv);
! 	elapsed_time = (double)microsec / 1.0e6;
  
  	if (result == STATE_OK) {
***************
*** 207,212 ****
  			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);
  	}
  	else if (result == STATE_WARNING)
--- 209,214 ----
  			multi_address = TRUE;
  
! 		printf (_("DNS ok - %.3f seconds response time, address%s %s|time=%ldus\n"),
! 						elapsed_time, (multi_address==TRUE ? "es are" : " is"), address, microsec);
  	}
  	else if (result == STATE_WARNING)

Index: check_smtp.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_smtp.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -r1.18 -r1.19
*** check_smtp.c	10 Aug 2003 06:53:22 -0000	1.18
--- check_smtp.c	10 Aug 2003 12:48:47 -0000	1.19
***************
*** 60,63 ****
--- 60,64 ----
  	int sd;
  	double elapsed_time;
+ 	long microsec;
  	int result = STATE_UNKNOWN;
  	char buffer[MAX_INPUT_BUFFER];
***************
*** 156,160 ****
  	alarm (0);
  
! 	elapsed_time = delta_time (tv);
  
  	if (check_critical_time && elapsed_time > (double) critical_time)
--- 157,162 ----
  	alarm (0);
  
! 	microsec = deltime (tv);
! 	elapsed_time = (double)microsec / 1.0e6;
  
  	if (check_critical_time && elapsed_time > (double) critical_time)
***************
*** 164,172 ****
  
  	if (verbose)
! 		printf (_("SMTP %s - %.3f sec. response time, %s|time=%.3f\n"),
! 		        state_text (result), elapsed_time, buffer, elapsed_time);
  	else
! 		printf (_("SMTP %s - %.3f second response time|time=%.3f\n"),
! 		        state_text (result), elapsed_time, elapsed_time);
  
  	return result;
--- 166,174 ----
  
  	if (verbose)
! 		printf (_("SMTP %s - %.3f sec. response time, %s|time=%ldus\n"),
! 		        state_text (result), elapsed_time, buffer, microsec);
  	else
! 		printf (_("SMTP %s - %.3f second response time|time=%ldus\n"),
! 		        state_text (result), elapsed_time, microsec);
  
  	return result;





More information about the Commits mailing list