[Nagiosplug-devel] Nagios plugin options -4 and -6
Jeremy T. Bouse
jeremy+nagios at undergrid.net
Sat Jun 28 23:52:02 CEST 2003
I have gone ahead and committed changes to check_ssh.c,
check_tcp.c, and netutils.[ch] which allow for easy use of -4 and -6
command line options...
I have defined a new extern int variable (address_family) in
netutils.h and default its assignment to AF_UNSPEC in netutils.c. This
is basically what the current default behavior is. To demonstrate it's
use and to test myself I have modified check_ssh and check_tcp to use
this by adding the following to the option parsing switch statement:
case '4':
address_family = AF_INET;
break;
case '6':
address_family = AF_INET6;
break;
I've also used --use-ipv4 and --use-ipv6 as standard long
options for both -4 and -6 respectively... Both are implimented in
check_ssh and check_tcp at this time...
This only affects the connection attempts themselves as the
modification only affects the my_connect() function in netutils.c... I
still need to modify is_inet_addr(), is_inet6_addr() and is_hostname()
to make use of address_family to determine during checks if a hostname
is valid or not... As well check_ping will take some work as I need to
modify the conditions under which it will attempt to use the PING6
command over the PING command...
With that in mind please leave check_ping to me to work on
initially... I will also work to get the hostname/address verification
functions utilizing this as soon as possible only with check_ping... I
would welcome help making the necessary changes to all other network
plugins which utilize netutils.h... From a cursory look it would appear
that work needs to be done on the following:
check_http, check_ldap, check_nt, check_nwstat, check_overcr,
check_real, check_smtp, check_time, check_udp and check_ups
These are the only other ones besides check_ssh, check_tcp and
check_ping which include netutils.h... If there are other network based
plugins not currently including netutils.h they will need to do so first
then make the modifications... This should not affect check_by_ssh which
already has a -4 and -6 (along with --use-ipv4 and --use-ipv6) which
only pass it on to the ssh command line call as it makes no direct
utilization of netutils...
Regards,
Jeremy
More information about the Devel
mailing list