[smokeping-users] Bug?

John_Delisle at ceridian.ca John_Delisle at ceridian.ca
Tue Oct 26 20:33:06 MEST 2004

I've discovered a bug in smokeping. (I think, correct me if this is
desired behaviour)
The code seems to scan through an RRD looking for the max values.  If
the max value is a three digit number (such as 120 in my case), the
regex and math following it break.

Input: 120, ie $maxmedian{$x} = 120

# make it a nice clean number
$maxmedian{$x} =~ s/^([0-9.]*)([1-9]).*/$1$2/;
$maxmedian{$x} += ( ${1}."1" + 0.0 ) ;

Returns: 23 ie $maxmedian{$x} = 23

This is probably not desired.  Graphs all look like crap, since they
can't plot correctly because the range is cut off very low.

I'm not sure what Tobi's trying to do in those two lines, so I'm not
sure how to correct them.

Maybe this will help troubleshoot.  It's some testing code.
sub foo {
 my $x=shift;

 print "Got:  $x\n";

 $x =~ s/^([0-9.]*)([1-9]).*/$1$2/;
 $x += ( ${1}."1" + 0.0 ) ;

 print "Made: $x\n\n";



John Delisle, CISA
Senior Network Analyst, Network and Security Team
Information Systems & Technology Management Dept.
Ceridian Canada Ltd
600 - 125 Garry St
Winnipeg, MB
R3C 3P2


This communication is intended to be received only by the individual(s) or entity(s) to whom or to which it is addressed, and contains information which is confidential, privileged and subject to copyright. Any unauthorized use, copying, review or disclosure is prohibited. Please notify the sender immediately if you have received this communication in error (by calling collect, if necessary) so that we can arrange for its return at our expense. Thank you in advance for your anticipated assistance and cooperation.


Unsubscribe mailto:smokeping-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:smokeping-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/smokeping-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi

More information about the smokeping-users mailing list