From: Buchan M. <bg...@st...> - 2014-09-01 15:30:46
|
----- Original Message ----- > Hello Martin, > > > 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'? But then you are introducing an inconsistency between the device and the graph name. I have for example considered putting the cdp test in a database and using it to make generation of a weathermap config (BTW., I use weathermap, among other things, to avoid having to scroll through lots of interface graphs to get to the one I want). Wouldn't it be better to log a feature request for Xymon to split RRD names on character/numeric boundaries and sort within the boundary? > I am using a patch to Devmon to solve this problem. It changes the > name of the interfaced part of the RRD file name. This causes the > alphabetical order to be the same as the numerical order. There is a > drawback however. For some of the interfaces the RRD file name > changes, causing new files to be generated once the patch is > applied. If you do not want to loose the history, you need to save / > restore / move those files. Anyway, you need to remove the RRD files > with the unsed interface names in it, as they will mesh up the > graphs on the Xymon page. > > The patch itself is: > > Index: dm_tests.pm > =================================================================== > --- dm_tests.pm (revision 13) > +++ dm_tests.pm (revision 14) > @@ -2022,6 +2022,11 @@ > for my $leaf (@{$rrd{$name}{'leaves'}}) { > my $pri_val = $oids->{$pri}{'val'}{$leaf}; > $pri_val =~ s/\s*//g; > + # > + # Map Cisco interface names like "Fa1/0/1" onto "Fa1/0/01". This > will cause a > + # nicer order of the graphs in the trends column in Xymon. > + # > + if ( $pri_val =~ > m/^(Fa\d\/|Fa\d\/\d\/|Gi\d\/\d\/|Gi\d\/|Po)(\d)$/ ) { > + $pri_val = $1 . '0' . $2 ; > + } elsif ( $pri_val =~ m/^(Vl)(\d{1,3})$/ ) { > + $pri_val = $1 . substr( '000' . $2, -4, 4 ) ; > + } # of elsif If this is the approach everyone wants, this needs at least Te, and possibly longer prefixes that can be used (if the device is configured for long names) such as GigabitEthernet, TegGigE etc. Regards, Buchan |