I use monit v5.16 running on Debian Wheezy to check if a server is up or down using the ping instruction.
Here is my configuration:
check host my.server.domain with address my.server.domain
mode passive
every 5 cycles
if failed ping4 count 5 then alert # IPv4 only
if failed ping6 count 5 then alert # IPv6 only
I always get the following error:
[CET Mar 1 23:28:32] error : Ping for my.server.domain -- getaddrinfo failed: Name or service not known
[CET Mar 1 23:28:32] error : 'my.server.domain' ping test failed
If I ping from the command line, everything works fine:
PING my.server.domain (yy.yyy.yyy.yyy) 56(84) bytes of data.
64 bytes from myoffice.com (xx.xxx.xx.xxx): icmp_req=1 ttl=54 time=1147 ms
I do not want to put anything into my /etc/hosts or anything hardcoded on the server where monit is running.
What could I do to solve this ? Is it a bug ?
Should I use another version of monit ? Is there any workaround ?