[Xymon] stop using dns and /etc/hosts
John Thurston
john.thurston at alaska.gov
Wed Mar 4 18:35:26 CET 2015
On 3/4/2015 3:41 AM, Asif Iqbal wrote:
> Use testip. man hosts.cfg
>
> On Mar 4, 2015 7:32 AM, "Ian Diddams" <didds3 at yahoo.co.uk
> <mailto:didds3 at yahoo.co.uk>> wrote:
>
> I have a hosts.cfg entry
>
> 1.2.3.4 server1
>
> where 1.2.3.4 is server1's INTERNAL IP address
>
> but its conn check is red because xymon is actually trying to ping
> its external, NATTed, address 5.6.7.8 which it cannot reach.
>
> Its because DNS is resolving the IP 5.6.7.8
>
> I can use a local hosts file entry to override that again, but I'd
> rather have some way fo telling xymon to only use entries in
> hosts.cfg and ignore native resolution.
To have Xymon test against the IP address you have specified (rather
than relying on DNS or hosts files), use the syntax:
1.2.3.4 server1.foo.com # testip
fwiw, in my installation, almost all of my lines are of the form:
0.0.0.0 server2.foo.com # ftp ssh
the only time I provide an IP address with the host is when the line
also contains the 'testip' tag. This makes editing my file less error
prone and makes it very obvious which hosts respond to name resolution
in unexpected ways.
Another way to address this is to have a DNS entry for your internal
address and a different entry for it's external (NAT'd) address.
In DNS, it might look like:
server1.foo.com A 5.6.7.8
server1.internal.foo.com A 1.2.3.4
In Xymon, hosts.cfg might contain:
0.0.0.0 server1.internal.foo.com # name:server1.foo.com
Xymon will perform network tests against a name it can resolve and an
address it can reach (server1.internal.foo.com). It will display those
results on its web page in a row named server1.foo.com
If you have a client installed on the host also reporting in, it should
identify itself as server1.internal.foo.com. If that isn't possible, you
can append the tag "client:server1.foo.com" to the end of the line in
hosts.cfg. This will permit the xymon server to match client reports
from server1.foo.com with the line in the hosts.cfg named
server1.internal.foo.com
--
Do things because you should, not just because you can.
John Thurston 907-465-8591
John.Thurston at alaska.gov
Enterprise Technology Services
Department of Administration
State of Alaska
More information about the Xymon
mailing list