[Nagiosplug-help] check_http and missing DNS fallback

Andy Shellam andy-lists at networkmail.eu
Mon Mar 30 19:23:29 CEST 2009


Steffen,

What's the configuration of that machine's /etc/resolv.conf? Plugin 
maintainers correct me if I'm wrong, but don't they just use the 
machine's gethostbyname or getservbyname functions? In which case it'd 
be down to your machine's resolver library.

However by the look of the error message, it does appear check_http is 
finding a valid IP address for <hostname> but then unable to connect to 
it. If you give it an invalid hostname (i.e. the result couldn't be 
gotten from DNS) the error message is different:

# /opt/nmail/nagios/libexec/check_http -H blah.blah.blah.com -u / -f 
warning -p 80 -w 3 -c 5 -t 10
Name or service not known
HTTP CRITICAL - Unable to open TCP socket

Try also adding a DROP rule to iptables at the same time for your 
secondary DNS, and see if the error message you get back is different.

Andy

Steffen Poulsen wrote:
>
> Hi,
>
> Is there any way to make check_http fallback on dns service used (like 
> other services at the machine)?
>
> A little test reveals that apparently only the primary DNS server is 
> in use, the second and following name servers are ignored.
>
> --
>
> [root at nag-test nagios-plugins-1.4.13]# ./plugins/check_http -H 
> <hostname> -u / -f warning -p 80 -w 3 -c 5 -t 10
>
> HTTP OK HTTP/1.1 200 OK - 356 bytes in 0.013 seconds 
> |time=0.012519s;3.000000;5.000000;0.000000 size=356B;;;0
>
> [root at nag-test nagios-plugins-1.4.13]# iptables -A INPUT -s <primary 
> dns> -j DROP
>
> [root at nag-test nagios-plugins-1.4.13]# ./plugins/check_http -H 
> <hostname> -u / -f warning -p 80 -w 3 -c 5 -t 10
>
> CRITICAL - Socket timeout after 10 seconds
>
> --
>
> I know there is a “-I” parameter for passing in the ip directly to the 
> check, but this is not the behavior I’m after - I still want the check 
> to be dynamic with regards to the IP address for the service.
>
> I hope I’m just missing the obvious?
>
> Best regards,
>
> Steffen
>
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------
>   
> ------------------------------------------------------------------------
>
> _______________________________________________
> Nagiosplug-help mailing list
> Nagiosplug-help at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagiosplug-help
> ::: 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 Help mailing list