0

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?

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

4 Answers4

1

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.

Keith
  • 4,637
  • 15
  • 25
  • 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 07:12
0

Try something like:

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

Emil C
  • 64
  • 3
  • Unfortunately this triggers the same error error message as above: "check_ping: Invalid hostname/address - somehost.local". – blerontin Jun 19 '13 at 08:56
0

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?

MintMania
  • 11
  • 1
0

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.

ank
  • 700
  • 5
  • 13