[rrd-users] Re: problems with "float" to rrd

mrugan mrugan at softhome.net
Sun Feb 22 01:18:44 MET 2004


ML> Hi list,
ML> first of all i'm new with rrd. Sometimes i got the following
ML> problems when update the database:

ML> root at Trinity:/_scripts/rrd# ./rrd_sysstat.sh
ML> 0.09:0.06:0.06:50284:84%:1%:35%:74%:4:20
ML> updating sysstat rrd database
ML> ERROR: conversion of '84%' to float not complete: tail '%'

ML> One or two minutes later it seems to work?!? Here is the output:

ML> root at Trinity:/_scripts/rrd# ./rrd_sysstat.sh
ML> 0.02:0.02:0.02:35572:84%:1%:35%:74%:4:21
ML> updating sysstat rrd database
ML> root at Trinity:/_scripts/rrd#

ML> I think the " % " should not be the problem. 

ML> Thanks for any help.
ML> Michael 

i had the same problem with my current rrdtool version 1.0.46 RRDs.

in my perl script it would complain about:
$procs=(`find /proc -maxdepth 1 -name '[1-9]*' -print | wc -l | sed 's/\t +//' | sed 's/ *//'`);
which outputs with couple blank spaces.(if u try it u will see what i
am talking about)  ... and the error was scalar to float ... something.

i've tried to set up a scalar() wrapup for the variable ... didn't worked.
so ... what's left [and works] is completly remove spaces with the following:

open(PS, "find /proc -maxdepth 1 -name '[1-9]*' -print | wc -l | sed 's/\t +//' | sed 's/ *//' |") || die "error: $!";
                     $_ =~ s/^\s+//;
                     $_ =~ s/\s+$//;

u're problem should be solved the same way since u're parsing uptime's
output {maybe? ... guessing} ..... [but in perl] not in bash [don't
see how remove with nifty shell tools white/blank spaces in a
reasonable way]

seems that RRDs complains now [didn't until now...] about some of our bad
habits of perl coding.

Best regards,
 mrugan                            mailto:mrugan at softhome.net

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

More information about the rrd-users mailing list