[Nagiosplug-checkins] CVS: nagiosplug/plugins check_ping.c,1.14,1.15

Jeremy T. Bouse undrgrid at users.sourceforge.net
Wed May 7 11:02:06 CEST 2003


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

Modified Files:
	check_ping.c 
Log Message:
Modified check_ping to handle IPv6 as well as IPv4 ICMP checks using the
PING6_COMMAND determined during the configure script execution. As 
USE_IPV6 may be defined and PING6_COMMAND is not defined if there is not 
IPv6 TCP stack available when configure is run I condition it off 
PING6_COMMAND existing to remove build errors for being undefined.


Index: check_ping.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_ping.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** check_ping.c	11 Mar 2003 22:22:11 -0000	1.14
--- check_ping.c	7 May 2003 18:01:32 -0000	1.15
***************
*** 105,113 ****
  
  		/* does the host address of number of packets argument come first? */
! #ifdef PING_PACKETS_FIRST
  		asprintf (&command_line, PING_COMMAND, max_packets, addresses[i]);
! #else
  		asprintf (&command_line, PING_COMMAND, addresses[i], max_packets);
! #endif
  
  		if (verbose)
--- 105,127 ----
  
  		/* does the host address of number of packets argument come first? */
! #ifdef PING6_COMMAND
! # ifdef PING_PACKETS_FIRST
! 	if (is_inet6_addr(addresses[i]))
! 		asprintf (&command_line, PING6_COMMAND, max_packets, addresses[i]);
! 	else
  		asprintf (&command_line, PING_COMMAND, max_packets, addresses[i]);
! # else
! 	if (is_inet6_addr(addresses[i]))
! 		asprintf (&command_line, PING6_COMMAND, addresses[i], max_packets);
! 	else
  		asprintf (&command_line, PING_COMMAND, addresses[i], max_packets);
! # endif
! #else /* USE_IPV6 */
! # ifdef PING_PACKETS_FIRST
! 		asprintf (&command_line, PING_COMMAND, max_packets, addresses[i]);
! # else
! 		asprintf (&command_line, PING_COMMAND, addresses[i], max_packets);
! # endif
! #endif /* USE_IPV6 */
  
  		if (verbose)





More information about the Commits mailing list