From: Jeremy L. <jla...@re...> - 2013-09-30 05:25:24
|
I think the order that graphs are displayed is governed by the rrd_name_compare() function inside showgraph.c. This sorts numerically for RRD filenames that are all numeric, otherwise by strcmp() order. I think the rrd_name_compare() is actually comparing the captured component of the FNPATTERN expression in devmon-graph.cfg. This is defined as: FNPATTERN if_load.(.*).rrd So I suppose it might be possible to redefine this to be something like this: FNPATTERN if_load.Gi0/(.*).rrd Then the captured expression will be entirely numeric, and it MIGHT cause Xymon to sort numerically. Of course this is only useful to you if you only have Gi0/* interfaces. You might be able to force this code to sort correctly by tweaking the Devmon template to pad the interface names with zeroes, so that you have Gi0/01, Gi0/02 ... Gi0/09 before Gi0/10. Alternatively, you could tweak the rrd_name_compare() function in Xymon to suit your requirements. This would be a useful change to Xymon. I think the best long-term option is to develop and submit a Xymon patch to handle this case. You could adjust rrd_name_compare() so that it looks for and handles two strings that only differ by numerics, and compares numerically. This would be somewhat complicated. More simply, you could allow defining some kind of flag to specify numeric or ASCII sort order in a graphs.cfg file. It might work like so: FNPATTERN if_load.(.*).rrd SORTNUMERIC yes I think this could all be done within web/showgraph.c. But I'm not a C programmer, so would be difficult for me to do reliably. Cheers Jeremy On 29 September 2013 00:22, Martin Davies <vas...@go...>wrote: > Hi all. > > Perhaps I'm just being lazy, but I'm looking for a way of changing how the > default if_load graphs are displayed on Xymon/Devmon. > > Xymon version is 4.3.12 > Devmon version is 0.3.1-beta1 > > What I want is for the graphs to be displayed in interface or numerical > order, but, out of the box, Devmon and Xymon display the graphs sorted in > alphabetical order. > > Normally this is not an issue, but it is slightly tedious to have to scroll > through the graph for interface Gi0/1 then through Gi0/10, Gi0/11, Gi0/12, > Gi0/13, Gi0/14, Gi0/15, Gi0/16, Gi0/17, Gi0/18 and Gi0/19 graphs to > eventually get to Gi0/2. is there not a way to either adjust the interface > so it reads Gi0/01, Gi0/02 etc or a flag to 'sort numerically'? > > Is this really a Devmon issue? If not, perhaps I should ask the same > question of the Xymon mailing list? > > Thanks > > Martin > > ------------------------------------------------------------------------------ > October Webinars: Code for Performance > Free Intel webinars can help you accelerate application performance. > Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most > from > the latest Intel processors and coprocessors. See abstracts and register > > http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk > _______________________________________________ > Devmon-support mailing list > Dev...@li... > https://lists.sourceforge.net/lists/listinfo/devmon-support > |