From: Buchan M. <bg...@st...> - 2010-04-07 08:27:42
|
On Wednesday, 7 April 2010 08:47:04 W.J.M. Nelis wrote: > Hello, > > by default, Devmon statistics in Xymon will show the last runtime, as > well as the average run-time of the last 5 runs. Is this the only/best metric to have? Since we now have per-worker statistics displayed on the dm test (in svn), I was considering adding per-thread polled host graphs. In this case, it might be better not to use the ncv collector, but the devmon collector (which can handle multiple rrd files with multiple DSs each) > I wanted to have a > graph showing the run-time of Devmon. I've made the following > modifications in module dm_msg.pm: From what base? It doesn't look like you've used the version in svn, which means your changes will conflict (the color of the dm test is now not hardcoded as green, but goes yellow if workers stop responding). > > [xymon]$ diff -u dm_msg.pm.org dm_msg.pm > --- dm_msg.pm.org 2009-01-22 17:42:12.000000000 +0100 > +++ dm_msg.pm 2010-03-19 09:17:44.000000000 +0100 > @@ -22,6 +22,7 @@ > use strict; > use Socket; > use dm_config; > + use POSIX qw/ strftime / ; > > # Our global variable hash > use vars qw(%g); > @@ -186,13 +187,21 @@ > $avg_time /= $num_polls; > $message .= "$avg_time seconds\n\n" . > "Poll time averaged over 5 poll cycles."; > - > } > > + # Replace ":" and "=" in order not to confuse the Xymon NCV module > + # Write the polling time (in HTML comment) for storage in an RRD > + $message =~ s/:/:/g ; > +# $message =~ s/=/=/g ; > + $message .= "<!--\n" . > + "PollTime : $this_poll_time\n" . > + "-->" ; > + > # Add the header > my $host = $g{'nodename'}; > $host =~ s/\./,/g; # Dont forget our FQDN stuff > - $message = "status $host.dm green ".(scalar > localtime)."\n\n$message\n"; > + my $now = $g{'bbdateformat'} ? > strftime($g{'bbdateformat'},localtime) : scalar(localtime); > + $message = "status $host.dm green $now\n\n$message\n"; > > return $message; > > Note that these modifications contain a second, independent enhancement > as well: the timestamp of test dm has been changed to use the format > specified in BBDATEFORMAT, if available. > > In order to get a graph, two configuration files of Xymon need some > exension. In file hobbitserver.cfg, variable TEST2RRD is extended with > "dm=ncv", and a new variable NCV_dm is defined: > NCV_dm="*:GAUGE" > > File hobbitgraph.cfg needs to be extended with a graph definition, > something like: > > [dm] > TITLE , Devmon runtime > YAXIS Runtime [s] > DEF:time=dm.rrd:PollTime:AVERAGE > LINE1:time#FF0000:Runtime > GPRINT:time:MIN:Min\: %5.1lf %ss > GPRINT:time:MAX:Max\: %5.1lf %ss > GPRINT:time:AVERAGE:Avg\: %5.1lf %ss > GPRINT:time:LAST:Cur\: %5.1lf %ss\n Regards, Buchan |