[Nagiosplug-devel] changes to host resolution behavior with AF-independent patches?

Karl DeBisschop karl at debisschop.net
Wed Mar 19 10:58:06 CET 2003


On Wed, 2003-03-19 at 12:30, Jeremy T. Bouse wrote:
> On Wed, Mar 19, 2003 at 09:48:46AM -0500, Karl DeBisschop wrote:
> > The current CVS head seems to do name resolution differently than it
> > used to (and not correctly, I think).
> > 
> > Jeremy - with a quick look, does it seem this might be a side effect of
> > your AF-independent patches (I have not looked at the code yet, though I
> > will if you don't recognize the change)
> >
> 	This might be possible... Most of the plugins (check_http
> included) call is_host() to verify if what is given is a valid IP
> address or hostname... is_host() in turn called the seperate function to
> check if it was a hostname [is_hostname()] or address[old:
> is_dotted_quad(), new:is_addr() which calls is_inet_addr() and/or
> is_inet6_addr()]...
> 
> 	Technically is_inet_addr(), is_inet6_addr() and is_hostname()
> are functionally the same now as they all call resolve_host_or_addr()
> just specifing a differetn Address Family (AF_INET, AF_INET6, AF_UNSPEC
> respectively). Then resolv_host_or_addr() calls the getaddrinfo()
> function to get the address info for the name given to it (either name
> or IP address (v4 or v6)... 
> 
> 	It's possible that is_hostname() should be reworked to use the
> resolver differently to take into account domain search paths which is
> what I suspect is causing the last condition...

Sorry - I should have had one more example.

It is not a search path issue -- it is a logic issue.

check_http -H d1.infoplease.com also fails

--
Karl

> > I think that the last example should work.
> > 
> > $ host d1
> > d1.infoplease.com has address 165.193.123.154
> > $ check_http -I 165.193.123.154 -H www.infoplease.com
> > HTTP OK HTTP/1.1 200 OK - 0.106 second response time |time=0.106
> 	This is as exected connecting to the IP address (-I) but using
> the host (-H) within the URI request and using the Host: header
> 
> > $ check_http -I 165.193.123.154                    
> > OK - HTTP/1.1 302 Found - 0.001 second response time |time=0.001
> 	This would be connecting to the same IP address but not sending
> a Host: header as the -H option is not given...
> 
> > $ check_http -H 165.193.123.154 
> > OK - HTTP/1.1 302 Found - 0.001 second response time |time=0.001
> 	This is functionally equivilent to the previous only it would
> send a 'Host: 165.193.123.154" instead of "Host: www.infoplease.com" as
> the first one would... 
> 
> > $ check_http -H d1              
> > CRITICAL - Socket timeout after 10 seconds
> 	This is the suspect one... Did it actually resolve d1 to
> d1.infoplease.com and resolve it's address to be 165.193.123.154 or not
> would be the first step... Is there any sign of the connection attempt
> being made? I believe it did or it would have given a usage error that
> the hostname was not valid
> 
> $ ./check_http -H d1
> Name or service not known
> 
> 	What may be happening then is that because the -H option was
> used it is sending "Host: d1" to the server which is then timing out
> trying to look it up and respond back... I suspect if you had tried
> 'check_http -I d1 -H www.infoplease.com' it would succeed without a
> problem or even 'check_http -I d1' which wouldn't even send the Host:
> header...
> 
> 	Can you confirm these findings?
> 
> 	Jeremy
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: Does your code think in ink? 
> You could win a Tablet PC. Get a free Tablet PC hat just for playing. 
> What are you waiting for?
> http://ads.sourceforge.net/cgi-bin/redirect.pl?micr5043en
> _______________________________________________
> Nagiosplug-devel mailing list
> Nagiosplug-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel
> ::: Please include plugins version (-v) and OS when reporting any issue. 
> ::: Messages without supporting info will risk being sent to /dev/null





More information about the Devel mailing list