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 ( 56(84) bytes of data.
64 bytes from somehost.local ( icmp_req=1 ttl=128 time=0.215 ms

How can I enable monitoring of hosts using dynamic IP?

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

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.

  • 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%

  • 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?


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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