mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-05-28 04:35:40 -04:00
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. git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@500 f882894a-f735-0410-b71e-b25c423dba1c
This commit is contained in:
parent
9d7f91d6dc
commit
6882b54364
1 changed files with 17 additions and 3 deletions
|
|
@ -104,11 +104,25 @@ main (int argc, char **argv)
|
|||
for (i = 0 ; i < n_addresses ; i++) {
|
||||
|
||||
/* does the host address of number of packets argument come first? */
|
||||
#ifdef PING_PACKETS_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
|
||||
# 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
|
||||
# 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)
|
||||
printf ("%s ==> ", command_line);
|
||||
|
|
|
|||
Loading…
Reference in a new issue