The -6 option of check_dig does not work as documented (#1228)
Stéphane Bortzmeyer
notifications at github.com
Mon Jan 27 15:12:10 CET 2014
When you monitor an IPv6 DNS server with check_dig -6, and uses the server name (not its IP address), check_dig falls back to IPv4 if the name server does not reply immediately in IPv6. It is not the behavior I expect (if I say -6, it is because I want to be sure IPv6 works).
Reading the source, it seems check_dig puts the -6 as the end of the command line (call to xasprintf ). Testing with dig on the command line, it seems indeed that -6 does not have the same semantics when used at the begin or at the end of the command line (before or after the server name). I therefore suggest this patch:
```
--- ./plugins/check_dig.c.orig 2014-01-27 14:55:56.000000000 +0100
+++ ./plugins/check_dig.c 2014-01-27 15:10:07.000000000 +0100
@@ -88,8 +88,8 @@
usage_va(_("Could not parse arguments"));
/* get the command to run */
- xasprintf (&command_line, "%s @%s -p %d %s -t %s %s %s",
- PATH_TO_DIG, dns_server, server_port, query_address, record_type, dig_args, query_transport);
+ xasprintf (&command_line, "%s %s @%s -p %d %s -t %s %s",
+ PATH_TO_DIG, query_transport, dns_server, server_port, query_address, record_type, dig_args);
alarm (timeout_interval);
gettimeofday (&tv, NULL);
̀`̀`
Yes, dig's parsing is... special.
---
Reply to this email directly or view it on GitHub:
https://github.com/monitoring-plugins/monitoring-plugins/issues/1228
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-plugins.org/archive/devel/attachments/20140127/c5b5d90b/attachment.html>
More information about the Devel
mailing list