[Nagiosplug-checkins] CVS: nagiosplug/plugins check_http.c,1.2,1.3

Karl DeBisschop kdebisschop at users.sourceforge.net
Fri Sep 13 19:24:03 CEST 2002


Update of /cvsroot/nagiosplug/nagiosplug/plugins
In directory usw-pr-cvs1:/tmp/cvs-serv19594/plugins

Modified Files:
	check_http.c 
Log Message:
time data in performance string

Index: check_http.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_http.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** check_http.c	24 Jun 2002 21:29:06 -0000	1.2
--- check_http.c	14 Sep 2002 02:23:55 -0000	1.3
***************
*** 727,731 ****
  	/* Exit here if server_expect was set by user and not default */
  	if ( server_expect_yn  )  {
! 		msg = ssprintf (msg, "HTTP OK: Status line output matched \"%s\"\n",server_expect);
  		if (verbose)
  			printf ("%s\n",msg);
--- 727,732 ----
  	/* Exit here if server_expect was set by user and not default */
  	if ( server_expect_yn  )  {
! 		msg = ssprintf (msg, "HTTP OK: Status line output matched \"%s\"\n",
! 	                  server_expect);
  		if (verbose)
  			printf ("%s\n",msg);
***************
*** 822,828 ****
  				printf ("HTTP CRITICAL");
  			time (&end_time);
! 			msg = ssprintf (msg, ": %s - %d second response time %s%s\n",
! 		                status_line, (int) (end_time - start_time),
! 		                timestamp, (display_html ? "</A>" : ""));
  			terminate (onredirect, msg);
  		} /* end if (strstr (status_line, "30[0-4]") */
--- 823,829 ----
  				printf ("HTTP CRITICAL");
  			time (&end_time);
! 			msg = ssprintf (msg, ": %s - %d second response time %s%s|time=%d\n",
! 		                 status_line, (int) (end_time - start_time), timestamp,
! 	                   (display_html ? "</A>" : ""), (int) (end_time - start_time));
  			terminate (onredirect, msg);
  		} /* end if (strstr (status_line, "30[0-4]") */
***************
*** 834,840 ****
  	/* check elapsed time */
  	time (&end_time);
! 	msg = ssprintf (msg, "HTTP problem: %s - %d second response time %s%s\n",
! 	               status_line, (int) (end_time - start_time),
! 	               timestamp, (display_html ? "</A>" : ""));
  	if (check_critical_time == TRUE && (end_time - start_time) > critical_time)
  		terminate (STATE_CRITICAL, msg);
--- 835,841 ----
  	/* check elapsed time */
  	time (&end_time);
! 	msg = ssprintf (msg, "HTTP problem: %s - %d second response time %s%s|time=%d\n",
! 	               status_line, (int) (end_time - start_time), timestamp,
! 	               (display_html ? "</A>" : ""), (int) (end_time - start_time));
  	if (check_critical_time == TRUE && (end_time - start_time) > critical_time)
  		terminate (STATE_CRITICAL, msg);
***************
*** 847,858 ****
  	if (strlen (string_expect)) {
  		if (strstr (page, string_expect)) {
! 			printf ("HTTP ok: %s - %d second response time %s%s\n",
  			        status_line, (int) (end_time - start_time),
! 			        timestamp, (display_html ? "</A>" : ""));
  			exit (STATE_OK);
  		}
  		else {
! 			printf ("HTTP CRITICAL: string not found%s\n",
! 			        (display_html ? "</A>" : ""));
  			exit (STATE_CRITICAL);
  		}
--- 848,859 ----
  	if (strlen (string_expect)) {
  		if (strstr (page, string_expect)) {
! 			printf ("HTTP ok: %s - %d second response time %s%s|time=%d\n",
  			        status_line, (int) (end_time - start_time),
! 			        timestamp, (display_html ? "</A>" : ""), (int) (end_time - start_time));
  			exit (STATE_OK);
  		}
  		else {
! 			printf ("HTTP CRITICAL: string not found%s|time=%d\n",
! 			        (display_html ? "</A>" : ""), (int) (end_time - start_time));
  			exit (STATE_CRITICAL);
  		}
***************
*** 862,874 ****
  		errcode = regexec (&preg, page, REGS, pmatch, 0);
  		if (errcode == 0) {
! 			printf ("HTTP ok: %s - %d second response time %s%s\n",
  			        status_line, (int) (end_time - start_time),
! 			        timestamp, (display_html ? "</A>" : ""));
  			exit (STATE_OK);
  		}
  		else {
  			if (errcode == REG_NOMATCH) {
! 				printf ("HTTP CRITICAL: pattern not found%s\n",
! 				        (display_html ? "</A>" : ""));
  				exit (STATE_CRITICAL);
  			}
--- 863,875 ----
  		errcode = regexec (&preg, page, REGS, pmatch, 0);
  		if (errcode == 0) {
! 			printf ("HTTP ok: %s - %d second response time %s%s|time=%d\n",
  			        status_line, (int) (end_time - start_time),
! 			        timestamp, (display_html ? "</A>" : ""), (int) (end_time - start_time));
  			exit (STATE_OK);
  		}
  		else {
  			if (errcode == REG_NOMATCH) {
! 				printf ("HTTP CRITICAL: pattern not found%s|time=%d\n",
! 				        (display_html ? "</A>" : ""), (int) (end_time - start_time));
  				exit (STATE_CRITICAL);
  			}
***************
*** 883,889 ****
  
  	/* We only get here if all tests have been passed */
! 	msg = ssprintf (msg, "HTTP ok: %s - %d second response time %s%s\n",
  	                status_line, (int) (end_time - start_time),
! 	                timestamp, (display_html ? "</A>" : ""));
  	terminate (STATE_OK, msg);
  	return STATE_UNKNOWN;
--- 884,890 ----
  
  	/* We only get here if all tests have been passed */
! 	msg = ssprintf (msg, "HTTP ok: %s - %d second response time %s%s|time=%d\n",
  	                status_line, (int) (end_time - start_time),
! 	                timestamp, (display_html ? "</A>" : ""), (int) (end_time - start_time));
  	terminate (STATE_OK, msg);
  	return STATE_UNKNOWN;





More information about the Commits mailing list