[Xymon] Display IP address on webpage

Jersey Man jersey_m at yahoo.com
Thu Oct 1 00:27:47 CEST 2015


We have several servers not in DNS. We are more familiar with the IPV4 addresses than names it helps us identify the host quicker 
I ended up using the NAME=$ip which worked
 


     On Monday, September 28, 2015 8:31 PM, Jeremy Laidman <jlaidman at rebel-it.com.au> wrote:
   

 
Is there a way to display the IP address instead of the hostname in the overview webpages. I suppose I can use the NAME tag but it would mean I have to add NAME tags to every host in host.cfg

Firsty, I'm curious why you would want to show the IP address and not the hostname.  If the IP address is more useful, why aren't the devices named "device-192-168-0-100"?
Secondly, do you know that you can click on an "info" link and get the IP addres?
Thirdly, I'm not aware of a simple way to do what you're asking, certainly nothing built in to Xymon.
Here are a few non-trivial options:
1. Modify the source code ;-)  Actually, there are several features that I'd love to see configurable in xymongen, such as: a) hover or click to show a pop-up with some basic information about the server, perhaps some or all of the "info" page, or the contents of the "notes" page; b) configurable click-to-connect to launch telnet:// or ssh:// URLs; c) click to popup an offline/online option for the host; d) similar for shift-clicking on a status dot.  Most, if not all of these, would have to be implemented in JavaScript, at least in part.  But an option to expand some variables in the NAME: and DESCR: tags to include $IP would be coded directly in xymongen C code.
2. You could automate the generation of the NAME tags in hosts.cfg.  Perhaps you could have a "hosts.src" file, and then you periodically create "hosts.cfg" such that it contains everything in "hosts.src" with an extra "NAME:192.168.0.100" type tag.
3. You could do a similar thing, but build a special include file containing only the IP address, hostname and alternative hostname, then use "dispinclude" to include this file BEFORE the real host description.  Like this:
hosts.cfg:
dispinclude named-by-ip.cfg
192.168.0.100 host1.example.com # noconn ssh192.168.1.53 host2.example.com # dns
named-by-ip.cfg:
192.168.0.100 host1.example.com # NAME:192.168.0.100192.168.1.53 host2.example.com # NAME:192.168.1.53
You would simply generate the file "named-by-ip.cfg" automatically whenever hosts.cfg is updated, or periodically.
4. You could probably do this sort of thing with some javascript magic.  I'm guessing it would be possible to include a little javascript within the page footer, that scans through the <span title=> tags, performs a web lookup to the "info" column to get the IP address, and replaces the hostname text.  I've done this kind of thing to allow hostnames to be clickable, enhancing the hostname text to be a hotlink to an "ssh://" or "telnet://" style URL.  Described here: http://lists.xymon.com/archive/2012-March/034227.html


  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20150930/f695aa48/attachment.html>


More information about the Xymon mailing list