[Nagiosplug-devel] [ nagiosplug-Bugs-1478287 ] check_dns fails with CNAMEs

SourceForge.net noreply at sourceforge.net
Tue Mar 17 09:06:20 CET 2009


Bugs item #1478287, was opened at 2006-04-28 05:43
Message generated for change (Comment added) made by dermoth
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1478287&group_id=29880

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
>Status: Closed
Resolution: Works For Me
Priority: 5
Private: No
Submitted By: James (jfidell)
Assigned to: Thomas Guyot-Sionnest (dermoth)
Summary: check_dns fails with CNAMEs

Initial Comment:
check_dns gives an error if the hostname being checked
is a CNAME instead of an A record:

DNS CRITICAL - '/usr/bin/nslookup -sil' msg parsing
exited with no address


This patch may be sub-optimal, but corrects the problem
for me:

--- check_dns.c~        Fri Apr 28 10:35:45 2006
+++ check_dns.c Fri Apr 28 10:35:52 2006
@@ -136,6 +136,13 @@
       non_authoritative = TRUE;
     }
 
+    else if ( strstr ( chld_out.line[i], query_address
) && !address ) {
+      if (( temp_buffer = strstr ( chld_out.line[i] +
strlen ( query_address ),
+          _("canonical name = ")))) {
+        address = strdup ( temp_buffer );
+      }
+    }
+
     result = error_scan (chld_out.line[i]);
     if (result != STATE_OK) {
       msg = strchr (chld_out.line[i], ':');


James

----------------------------------------------------------------------

>Comment By: Thomas Guyot-Sionnest (dermoth)
Date: 2009-03-17 04:06

Message:
This bug apparently did not close itself after a week - closing now.

Feel free to reopen if it's still an issue.

----------------------------------------------------------------------

Comment By: Thomas Guyot-Sionnest (dermoth)
Date: 2009-02-24 04:19

Message:
Works for me, even if the server does not return an address (CNAME only)

If you still have issues, please post the full verbose output (-vvv) of
check_dns from the latest release (or even better latest source tarball).
I'll mark this as pending for now - this bug will close itself in a week.

----------------------------------------------------------------------

Comment By: James (jfidell)
Date: 2007-06-11 05:05

Message:
Logged In: YES 
user_id=1510516
Originator: YES

OS is FreeBSD 6.0.  Not sure about the nslookup version as it seems to
defy my attempts to find out.

IIRC correctly (as this was some time ago), the problem is not
specifically that the format of output of
nslookup is different, but that in same circumstances check_dns
mis-handles the output.  I *think*
the problem is that for some configurations (could be where the CNAME is
in a different domain, or where
it is served by a different nameserver, or perhaps just depending on the
nameserver implementation),
nslookup may not return a "Name:" or "Address:" line at all, even though
the nameserver being queried can
and does answer properly that the queried hostname is a canonical name.

----------------------------------------------------------------------

Comment By: Matthias Eble (psychotrahe)
Date: 2007-06-11 04:17

Message:
Logged In: YES 
user_id=1694341
Originator: NO

Announced pending state by sending emails to the participants.

----------------------------------------------------------------------

Comment By: Matthias Eble (psychotrahe)
Date: 2007-06-04 12:00

Message:
Logged In: YES 
user_id=1694341
Originator: NO

Which OS version/nslookup version are you running? On Ubuntu Linux (6.06)
everything is fine with cnames, too.

nslookup output looks like this:

...
foo.de.tld canonical name = bar.tld.
Name:   bar.tld
Address: x.x.x.x

Could you post your output, too?

Thanks Matthias

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1478287&group_id=29880




More information about the Devel mailing list