[Nagiosplug-checkins] CVS: nagiosplug/plugins check_http.c,1.44,1.45

Karl DeBisschop kdebisschop at users.sourceforge.net
Tue Aug 19 04:20:02 CEST 2003


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

Modified Files:
	check_http.c 
Log Message:
*add missing status numbers from RFC 2616 (HTTP1.1)

Index: check_http.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_http.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -C2 -r1.44 -r1.45
*** check_http.c	10 Aug 2003 06:53:21 -0000	1.44
--- check_http.c	19 Aug 2003 11:19:09 -0000	1.45
***************
*** 644,669 ****
  		/* check the return code */
  		/* server errors result in a critical state */
! 		if (strstr (status_line, "500") ||
! 	  	  strstr (status_line, "501") ||
! 	    	strstr (status_line, "502") ||
! 		    strstr (status_line, "503")) {
! 			die (STATE_CRITICAL, _("HTTP CRITICAL: %s\n"), status_line);
  		}
  
  		/* client errors result in a warning state */
! 		if (strstr (status_line, "400") ||
! 	  	  strstr (status_line, "401") ||
! 	    	strstr (status_line, "402") ||
! 		    strstr (status_line, "403") ||
! 		    strstr (status_line, "404")) {
  			die (STATE_WARNING, _("HTTP WARNING: %s\n"), status_line);
  		}
  
  		/* check redirected page if specified */
! 		if (strstr (status_line, "300") ||
! 	  	  strstr (status_line, "301") ||
! 	    	strstr (status_line, "302") ||
! 		    strstr (status_line, "303") ||
! 		    strstr (status_line, "304")) {
  			if (onredirect == STATE_DEPENDENT) {
  
--- 644,671 ----
  		/* check the return code */
  		/* server errors result in a critical state */
! 		if (strstr (status_line, "500") || strstr (status_line, "501") ||
! 		    strstr (status_line, "502") || strstr (status_line, "503") ||
! 		    strstr (status_line, "504") || strstr (status_line, "505")) {
!  			die (STATE_CRITICAL, _("HTTP CRITICAL: %s\n"), status_line);
  		}
  
  		/* client errors result in a warning state */
! 		if (strstr (status_line, "400") || strstr (status_line, "401") ||
! 		    strstr (status_line, "402") || strstr (status_line, "403") ||
! 		    strstr (status_line, "404") || strstr (status_line, "405") ||
! 		    strstr (status_line, "406") || strstr (status_line, "407") ||
! 		    strstr (status_line, "408") || strstr (status_line, "409") ||
! 		    strstr (status_line, "410") || strstr (status_line, "411") ||
! 		    strstr (status_line, "412") || strstr (status_line, "413") ||
! 		    strstr (status_line, "414") || strstr (status_line, "415") ||
! 		    strstr (status_line, "416") || strstr (status_line, "417")) {
  			die (STATE_WARNING, _("HTTP WARNING: %s\n"), status_line);
  		}
  
  		/* check redirected page if specified */
! 		if (strstr (status_line, "300") || strstr (status_line, "301") ||
! 		    strstr (status_line, "302") || strstr (status_line, "303") ||
! 		    strstr (status_line, "304") || strstr (status_line, "305") ||
! 		    strstr (status_line, "306")) {
  			if (onredirect == STATE_DEPENDENT) {
  





More information about the Commits mailing list