Standard Nagios Plugins 1.4.9 and IPv6 problem?

Holger Weiss holger at CIS.FU-Berlin.DE
Fri Sep 21 16:59:57 CEST 2007


* "Frost, Mark {PBG}" <mark.frost1 at pepsi.com> [2007-09-20 14:36]:
> The thing about #3 is that it seems that no matter how compile the
> plugins, it will still use IPv6 if it detects that your include files
> support AF_INET6.  You can't turn it off short of finding some way to
> turn it off in your OS which seems a bit extreme to me.  I've always
> accepted that on any flavor of Linux I use, IPv6 is available even if
> I'm not using it.  The idea that some application is going to start
> using it when I have no configured interface or any other indication
> that IPv6 is in use baffles me.  Beyond that that these plugins would
> opt to generate an extra say 4x network traffic that I can explicitly
> tell them not to also baffles me.  I mean, what do I have to do to
> convince 'check_nt' that no, I really really really don't want it
> sending out IPv6 traffic?

To be nitpicking, it doesn't "send out IPv6 traffic", it merely asks
your resolver library for the address of some host name without
explicitely stating that it's only interested in an IPv4 address.
Asking for an IPv4 address only is certainly possible, though IMO it's
more appropriate to disable IPv6 system-wide if, well, you want it
disabled system-wide.  However, disabling IPv6 lookups on the
application level can of course be useful in certain cases within mixed
v4/v6 environments.  And I agree that "--without-ipv6" doesn't do what
you'd expect it to do.  At least it doesn't seem to be a documented
option :-)

Anyway, if noone beats me on it, I'll fix "--without-ipv6" for the next
release (at least for most C plugins), and I'll put "-4"/"-6" flags for
all plugins which lookup host names on my TODO list.  Until then, the
following patch should work around your problem for most C plugins:

-----------------------------------------------------------
--- netutils.c.orig	2007-01-20 07:07:48.000000000 +0100
+++ netutils.c	2007-09-21 16:28:13.117372070 +0200
@@ -39,7 +39,7 @@
 unsigned int socket_timeout = DEFAULT_SOCKET_TIMEOUT; 
 int econn_refuse_state = STATE_CRITICAL;
 int was_refused = FALSE;
-int address_family = AF_UNSPEC;
+int address_family = PF_INET;
 
 /* handles socket timeouts */
 void
-----------------------------------------------------------

Holger

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list