[Nagiosplug-checkins] CVS: nagiosplug/plugins check_dns.c,1.8.2.3,1.8.2.4

Karl DeBisschop kdebisschop at users.sourceforge.net
Fri Aug 1 22:31:01 CEST 2003


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

Modified Files:
      Tag: r1_3_0
	check_dns.c 
Log Message:
restore informative output that was lost in previous bug fix

Index: check_dns.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_dns.c,v
retrieving revision 1.8.2.3
retrieving revision 1.8.2.4
diff -C2 -r1.8.2.3 -r1.8.2.4
*** check_dns.c	31 May 2003 14:39:33 -0000	1.8.2.3
--- check_dns.c	2 Aug 2003 05:30:21 -0000	1.8.2.4
***************
*** 210,213 ****
--- 210,214 ----
  }
  
+ 
  int
  error_scan (char *input_buffer)
***************
*** 215,268 ****
  
  	/* the DNS lookup timed out */
! 	if (strstr (input_buffer,
! 	     "Note:  nslookup is deprecated and may be removed from future releases.")
! 	    || strstr (input_buffer,
! 	     "Consider using the `dig' or `host' programs instead.  Run nslookup with")
! 	    || strstr (input_buffer,
! 	     "the `-sil[ent]' option to prevent this message from appearing."))
  		return STATE_OK;
  
  	/* the DNS lookup timed out */
  	else if (strstr (input_buffer, "Timed out"))
! 		return STATE_WARNING;
  
  	/* DNS server is not running... */
  	else if (strstr (input_buffer, "No response from server"))
! 		return STATE_CRITICAL;
  
  	/* Host name is valid, but server doesn't have records... */
  	else if (strstr (input_buffer, "No records"))
! 		return STATE_WARNING;
! 
! 	/* Host or domain name does not exist */
! 	else if (strstr (input_buffer, "Non-existent"))
! 		return STATE_CRITICAL;
! 	else if (strstr (input_buffer, "** server can't find"))
! 		return STATE_CRITICAL;
! 	else if(strstr(input_buffer,"NXDOMAIN")) /* 9.x */
! 		return STATE_CRITICAL;
  
  	/* Connection was refused */
! 	else if (strstr (input_buffer, "Connection refused"))
! 		return STATE_CRITICAL;
  
  	/* Network is unreachable */
  	else if (strstr (input_buffer, "Network is unreachable"))
! 		return STATE_CRITICAL;
  
  	/* Internal server failure */
  	else if (strstr (input_buffer, "Server failure"))
! 		return STATE_CRITICAL;
! 
! 	/* DNS server refused to service request */
! 	else if (strstr (input_buffer, "Refused"))
! 		return STATE_CRITICAL;
  
  	/* Request error */
  	else if (strstr (input_buffer, "Format error"))
! 		return STATE_WARNING;
  
! 	else
! 		return STATE_OK;
  
  }
--- 216,262 ----
  
  	/* the DNS lookup timed out */
! 	if (strstr (input_buffer,	"Note:  nslookup is deprecated and may be removed from future releases.") ||
! 	    strstr (input_buffer, "Consider using the `dig' or `host' programs instead.  Run nslookup with") ||
! 	    strstr (input_buffer, "the `-sil[ent]' option to prevent this message from appearing."))
  		return STATE_OK;
  
  	/* the DNS lookup timed out */
  	else if (strstr (input_buffer, "Timed out"))
! 		terminate (STATE_WARNING, "Request timed out at server\n");
  
  	/* DNS server is not running... */
  	else if (strstr (input_buffer, "No response from server"))
! 		terminate (STATE_CRITICAL, "No response from name server %s\n", dns_server);
  
  	/* Host name is valid, but server doesn't have records... */
  	else if (strstr (input_buffer, "No records"))
! 		terminate (STATE_CRITICAL, "Name server %s has no records\n", dns_server);
  
  	/* Connection was refused */
! 	else if (strstr (input_buffer, "Connection refused") ||
! 	         (strstr (input_buffer, "** server can't find") &&
! 	          strstr (input_buffer, ": REFUSED")) ||
! 	         (strstr (input_buffer, "Refused")))
! 		terminate (STATE_CRITICAL, "Connection to name server %s was refused\n", dns_server);
! 
! 	/* Host or domain name does not exist */
! 	else if (strstr (input_buffer, "Non-existent") ||
! 	         strstr (input_buffer, "** server can't find") ||
! 	         strstr (input_buffer,": NXDOMAIN"))
! 		terminate (STATE_CRITICAL, "Domain %s was not found by the server\n", query_address);
  
  	/* Network is unreachable */
  	else if (strstr (input_buffer, "Network is unreachable"))
! 		terminate (STATE_CRITICAL, "Network is unreachable\n");
  
  	/* Internal server failure */
  	else if (strstr (input_buffer, "Server failure"))
! 		terminate (STATE_CRITICAL, "Server failure for %s\n", dns_server);
  
  	/* Request error */
  	else if (strstr (input_buffer, "Format error"))
! 		terminate (STATE_WARNING, "Format error\n");
  
! 	return STATE_OK;
  
  }





More information about the Commits mailing list