that's what i did.. rrdtool dump (or fetch) ... gives me only nan's in the dump i see in <last ds> (?) an extended value (eg. 4.000000e+10) but for AVERAGE, MIN, MAX i get only nan. which is weird. the only diffs i see between my implementation and roys' is that he uses perl extensions and i use shell script outputted by a c program that gathers data from tc and compares the classes with a config file to get the name of the clients. my program is an extension to htb-utils. On Sat, 2004-07-31 at 02:58, Tadas wrote: > I dont see anything wrong with your script, > but you did not show the part which displays graphs. > > For testing you can try to dump your database as xml it helps to test if > you create and update it correctly. > if all data is good, then you are incorrectly displaying it. > > > > ----- Original Message ----- > From: "Adrian Vasile" <adi@xxxxxxxxxx> > To: "Roy" <roy@xxxxxx> > Sent: Saturday, July 31, 2004 2:20 AM > Subject: Re: tc &amp; rrd question > > > > thanks for the info. i'll try implementing it as soon as > > possible. > > > > i've been using this line: for creating the db's: > > > > $RRDTOOL create /var/rrd/eth0/upload.rrd \ > > DS:Speed:GAUGE:600:0:U \ > > DS:Bytes:COUNTER:600:0:U \ > > RRA:AVERAGE:0.5:1:288 > > RRA:MIN:0.5:1:24 \ > > RRA:MAX:0.5:1:24 > > i see some diffs i don't set the step size (man page says default is 300 > > aka 5min) and heartbeat double. the avg is set to 24h with 12 points per > > hour.i realize it's not too exact but for testing purposes works :) > > Do you log only last 24 points of min and max? > > if you want one point per hour you should use > 60min/5min =12 > RRA:MIN:0.5:12:24 > > > > > > and i use crontab to periodically run the update script: > > > > $RRDTOOL update /var/rrd/eth0/upload.rrd N:57:1202599 > > i use N: for now time (as per the man page) > > > > the problem appears when i fetch the data i get only 'nan'. i'm thinking > > that i may be putting the data the wrong way or something but i've been > > hitting a stone wall searching on this problem (docs, mailing lists). > > > > On Fri, 2004-07-30 at 16:53, Roy wrote: > > > Basicaly it is easy to use rrd tool, the hardest part for me > > was to setup > > > rrd database correctly > > > here is example > > > > > > RRDs::create('"'$rrd'"','"'-s'"',$period, > > > '"'DS:TR:GAUGE:300:0:U'"', > > > '"'RRA:AVERAGE:0.5:1:1440'"', # 0.5- > > uaualy leave as is : 1- > > > for first entry use 1 :1440 number of points > > > '"'RRA:AVERAGE:0.5:15:3072'"'); #: 0.5: 15 > > needs 15 updates to > > > create one average database entry :3072 > > > > > > > > > Complete example for perl, probably will be good for you too. > > have > > > resolution of 1 min for 1 day and 15 min resolution for 1 > > month. uopdates > > > should be done each minute > > > $time=time; > > > $rrd='"'./data/$ip.rrd'"'; #$rrd is filename > > > if (!(-e '"'$rrd'"')) { print '"'creating > > $rrd\n'"'; > > > > > RRDs::create('"'$rrd'"','"'-s'"',$period, > > > '"'DS:TR:GAUGE:300:0:U'"', > > > '"'RRA:AVERAGE:0.5:1:1440'"', > > > '"'RRA:AVERAGE:0.5:15:3072'"'); > > > if (my $error=RRDs::error()) {print '"'Cannot create > > $rrd: $error\n'"';} > > > } > > > > > > RRDs::update('"'$rrd'"','"'$time:$tr'"'); # > > $tr is the data you want to add to > > > database > > > > > > if (my $error=RRDs::error()) {print '"'Cannot update $rrd: > > $error\n'"';} > > > > > > } > > > ################## > > > example for view script. shows load graph and total traffic per > > $period > > > $period is in seconds > > > > > > $period=3600*24; #(for one day) > > > > > > $start=time-$period; #starts from current time. > > > $rrd='"'./data/$ip.rrd'"'; > > > RRDs::graph > > ('"'$cache/$name.png'"','"'--start=$start'"','"'--width=720'"', > > > '"'DEF:d=$rrd:TR:AVERAGE'"', > > > '"'CDEF:down=d,UN,0,d,IF,$period,*'"', > > > '"'LINE1:d#6600cc'"', > > > '"'GPRINT:down:AVERAGE:%1.1lf%sB Download'"', > > > ); > > > > > > if (my $error=RRDs::error()) {print '"'Cannot graph > > $rrd: $error\n'"';} > > > > > > print '"'<img src=\'"'$cache/$name.png\'"'> > > \n'"'; > > > print '"'$name $ip<br>\n'"'; > > > } > > > > > > > > > > > > > > > > > > > > > > > > > > > ----- Original Message ----- > > > From: http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: > http://lartc.org/ > > > > > > > > > > _______________________________________________ > > > LARTC mailing list / LARTC@xxxxxxxxxxxxxxx > > > http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/ > > > > > > > > > _______________________________________________ LARTC mailing list / LARTC@xxxxxxxxxxxxxxx http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/