[Xymon] Display IP address on webpage
Galen Johnson
Galen.Johnson at sas.com
Tue Sep 29 04:19:54 CEST 2015
RE: 4 response...alas, the pastebin link referred to in the archived message has long since expired. I don't suppose you ever posted it to Xymonton (under "addons") or elsewhere?
=G=
________________________________
From: Xymon <xymon-bounces at xymon.com> on behalf of Jeremy Laidman <jlaidman at rebel-it.com.au>
Sent: Monday, September 28, 2015 8:31 PM
To: Jersey Man
Cc: Xymon at xymon.com
Subject: Re: [Xymon] Display IP address on webpage
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<http://host1.example.com> # noconn ssh
192.168.1.53 host2.example.com<http://host2.example.com> # dns
named-by-ip.cfg:
192.168.0.100 host1.example.com<http://host1.example.com> # NAME:192.168.0.100
192.168.1.53 host2.example.com<http://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/20150929/4b68488c/attachment.html>
More information about the Xymon
mailing list