[Xymon] Bug in TRENDS handling?

Jeremy Laidman jlaidman at rebel-it.com.au
Tue Dec 1 14:33:46 CET 2015


Hiya

I think I've found a rather obscure bug in the handling of the TRENDS
overrides in hosts.cfg.  For example, the following hosts.cfg entry doesn't
do what I'd expect:

192.168.0.1 server1.example.com #
TRENDS:*,netstat_enhanced:ns1|ns2,netstat:netstat|netstat1

(Assume that GRAPHS in xymonserver.cfg includes "netstat" and
"netstat_enhanced".)

I would expect that the trends page for this host would have graphs of ns1,
ns2 (in place of netstat_enhanced), and netstat and netstat1 (in place of
just netstat).

However, it appears that the "nestat_enhanced" entry masks the "netstat"
entry, and the latter is set to the default of showing only the "netstat"
graph.

Another example is, if I have
TRENDS:*,_vmstat_,vmstat:vmstat|vmstat3|vmstat4|vmstat5,...
then my trends page shows only the one "vmstat" graph.  After removing the
"_vmstat_" I get four vmstat graphs as specified.

If I upper-case any of the characters in the earlier definition, or if I
move the definition to be later, everything works as expected.

I had a quick look at the code, but I can't read C well enough to find the
bug.  Although I'm starting to suspect that the strstr() in
svcstatus-trends.c might be successfully sub-string matching.  Instead, it
should match only a whole word (perhaps terminated by whitespace, comman,
pipe and colon.  But this is a guess, really.

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


More information about the Xymon mailing list