Page 1 of 1

host address as example.local.

Posted: Thu May 03, 2012 8:24 pm
by clayton256
Hi,

I'm new to nagios so please have mercy on me :-)

If I use an ip address as the host address in my config everything works fine. If I use the mdns machine name with .local, I get an error that the host is down. The error is one of two "Plugin timed out after 10 seconds" or "popen timeout received, but no child process". What am I doing wrong? It's also interesting that the service for these hosts work just fine so it apprears that nagios can resolve the mdns host name?

I'm using the version that comes with ubuntu.

Thanks,
Mark Clayton

Re: host address as example.local.

Posted: Fri May 04, 2012 10:49 am
by agriffin
Is your host check just a ping?

If you run the check from the command line do you get the same error?

Code: Select all

# su nagios
$ check_ping ...

Re: host address as example.local.

Posted: Fri May 04, 2012 12:40 pm
by clayton256
Yes, I get the same error:

Code: Select all

$ /usr/lib/nagios/plugins/check_ping -H 10.0.1.7 -w 100.0,60% -c 200.0,90%
PING OK - Packet loss = 0%, RTA = 37.42 ms|rta=37.422001ms;100.000000;200.000000;0.000000 pl=0%;60;90;0
$ /usr/lib/nagios/plugins/check_ping -H jmc-VirtualBox.local. -w 100.0,60% -c 200.0,90%
CRITICAL - Plugin timed out after 10 seconds

$ /usr/lib/nagios/plugins/check_ping -H 10.0.1.98 -w 100.0,60% -c 200.0,90%
PING OK - Packet loss = 0%, RTA = 2.58 ms|rta=2.577000ms;100.000000;200.000000;0.000000 pl=0%;60;90;0
$ /usr/lib/nagios/plugins/check_ping -H EPSON154272.local. -w 100.0,60% -c 200.0,90%
CRITICAL - popen timeout received, but no child process
After looking over the code and playing around with parameters to check_ping I notice a few things. If I add a timeout value (-t 111) and make it verbose (-vvv) I get the ping command passed to spopen. So I see a little better what it's doing. If the mDNS address is a printer or router check_ping correctly uses ping4 even though it gives error: "popen timeout received, but no child process". If the mDNS address is another linux box, check_ping uses ping6 which fails with: "CRITICAL - Plugin timed out after 10 seconds".

I appears that a decent work around for me is to add -4 and -t to the ping command. Where is the right place to do this?

Thanks,
Mark

Re: host address as example.local.

Posted: Fri May 04, 2012 1:21 pm
by agriffin
You'll want to modify the command definition of the host check. By default I think it's called check-host-alive located in commands.cfg. It may be using check_icmp instead of check_ping, but it's safe to replace it with check_ping.

Re: host address as example.local.

Posted: Fri May 04, 2012 7:34 pm
by clayton256
Thx! Got it working as you suggested.

Mark

Re: host address as example.local.

Posted: Mon May 07, 2012 9:36 am
by agriffin
Glad I could help you!