[Xymon] Patch - fix for zoom icon when no graph

John Horne john.horne at plymouth.ac.uk
Wed Mar 28 18:25:30 CEST 2012


Hello,

I mentioned before about how some status pages show no graph but do show
the small magnifying glass zoom icon
(http://lists.xymon.com/pipermail/xymon/2012-March/034158.html )

I have looked at the code about this, and I can see it is not a simple
task to prevent the icon from appearing when their is no graph.
Unfortunately the graph is handled in one part of the code, and the icon
is just a simple bit of HTML to show the icon image. The two are not
related in any way, so it is not possible to just say "if there's no RRD
file then don't show the icon".

However, there is one place in the code where the URL containing the
graph and icon is passed through deeper into the code. By changing the
URL at this point neither the graph nor icon will appear when required.

To do this I have created two variables in xymonserver.cfg that the user
can adjust as required. One variable specifies the test names that use
the TRACK option (so 'files', 'procs' and 'ports'). The second variable
is empty by default, but can contain a <hostname.<test> pair such as
'server1.procs'. The code will check if such a pair has been set for the
host/test being checked, and if so then the graph will be shown.

So by default no graphs are shown for the 'files', 'procs' and 'ports'
tests until the user uses a TRACK option, and modifies the new settings.

Some 'wildcarding' is possible. To return to the previous behaviour of
all graphs being shown, just set the TRACKEDTESTS option to "". To show
the (for example) 'procs' graphs for all hosts, just remove 'procs' from
the TRACKEDTESTS option. To show all the graphs for a particular host
use something like 'server1.*' (where 'server1' is the hostname).

I'm not entirely happy with this fix, but it does seem to work. If there
are a lot of hosts then the variables could get large in size. There is
no accurate check of the host/test pair, in that they are not
specifically delimited. (I was thinking of a space-separated list but
ensuring that the list starts and ends with a space is awkward.) So, for
example, the pair 'abc.procs' would match 'server-abc.procs'. The code
uses trees for some of its structures, and I took a very quick look to
see if maybe something could be included in there when a TRACKed option
was used. That would probably be better.

Attached are the patches, use them if you wish. Only 2 files provide the
code (which admittedly is only a small change), the rest are
documentation (the man pages and html pages, installed analysis.cfg
etc). The patches were produced against the 4.3.7 code.




John.

-- 
John Horne                   Tel: +44 (0)1752 587287
Plymouth University, UK      Fax: +44 (0)1752 587001
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xymonrrd.c.patch
Type: text/x-patch
Size: 1477 bytes
Desc: not available
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20120328/767a03e6/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: environ.c.patch
Type: text/x-patch
Size: 411 bytes
Desc: not available
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20120328/767a03e6/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: analysis.cfg.5.html.patch
Type: text/x-patch
Size: 1959 bytes
Desc: not available
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20120328/767a03e6/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: analysis.cfg.5.patch
Type: text/x-patch
Size: 2018 bytes
Desc: not available
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20120328/767a03e6/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: analysis.cfg.patch
Type: text/x-patch
Size: 3232 bytes
Desc: not available
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20120328/767a03e6/attachment-0004.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xymonserver.cfg.5.html.patch
Type: text/x-patch
Size: 1880 bytes
Desc: not available
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20120328/767a03e6/attachment-0005.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xymonserver.cfg.5.patch
Type: text/x-patch
Size: 1731 bytes
Desc: not available
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20120328/767a03e6/attachment-0006.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xymonserver.cfg.DIST.patch
Type: text/x-patch
Size: 610 bytes
Desc: not available
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20120328/767a03e6/attachment-0007.bin>


More information about the Xymon mailing list