Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I currently have problems monitoring up-time of a target machine in Nagios/Icinga that uses dynamic IP address. The network is using a Windows domain controller for DNS, Icinga server is running on a Ubuntu machine inside the network.

When running "check_ping" command manually I get the following error:

> ./check_ping -H somehost -w 10,1% -c 20,2%
check_ping: Invalid hostname/address - somehost

When I run "ping" instead it works:

> ping somehost
PING somehost.local (192.168.0.206) 56(84) bytes of data.
64 bytes from somehost.local (192.168.0.206): icmp_req=1 ttl=128 time=0.215 ms

How can I enable monitoring of hosts using dynamic IP?

share|improve this question
    
Assigning a static IP (possible through DHCP, no client reconfiguration needed!) is not an option? –  Squeezy Jun 19 '13 at 19:15

4 Answers 4

up vote 1 down vote accepted

Since your AD domain is (unfortunately) using ".local" for a DNS suffix, you probably have a conflict with mDNS (AKA zeroconf, bonjour, etc.)

Ubuntu ships with Avahi mDNS installed/enabled by default. You might have to disable (via nsswitch) or remove the avahi packages to allow non-mDNS host resolution for .local DNS names.

Also, you might want to use check_icmp instead of check_ping, as it's about 10 times faster.

share|improve this answer
    
Thanks for the hint with ".local" suffix. I have different nameservers configured, one for the local domain and another for external hosts. It seems that the problem has been the local Dnsmasq instance started by NetworkManager which did not query the nameservers in the specified order (first local then external). I have disabled the local Dnsmasq (commented out line dns=dnsmasq in /etc/NetworkManager/NetworkManager.conf), restarted NetworkManager and now check_ping and check_icmp works for "somehost". I does not work for "somehost.local" but I can live with that. –  blerontin Jun 20 '13 at 7:12

Try something like:

./check_ping -H somehost.local -w 10,1% -c 20,2%

share|improve this answer
    
Unfortunately this triggers the same error error message as above: "check_ping: Invalid hostname/address - somehost.local". –  blerontin Jun 19 '13 at 8:56

One suggestion that's more a workaround than answer to your specific question.

What's acting as DHCP server on your network? Perhaps it would be an idea to set up reservation/ static ip for 'somehost', and then use your check_ping script with ip instead of hostname.

In fact for test purposes, does the check_ping work with ip rathar than hostname?

share|improve this answer

What you need is dynamic updates from the DHCP server to the DNS server such that the host A record will always get the same name regardless of the IP address assigned. Then your "check_ping -H host-name" will always point to the correct address.

Sorry, I have no idea how this works in Windows DHCP/DNS.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.