[rrd-users] Question about RRDTool ..

Jean-Yves Avenard jyavenard at gmail.com
Thu Mar 20 05:00:48 CET 2008


Hello

Discovered RRDTool not long ago and I'm able to pretty much work just
like I need it to.
However I am experiencing some issues in a particular case.

I am trying to collect some data at 3 hours interval, trying to
simulate what MRTG would be doing.
I want to keep record of those data of a full year and calculate the
average, min and max for:
-Daily view
-Weekly view (so gather the data over the past 7 days and keep it for a month)
-Monthly view (gather the data over the past 31 days and keep it for one year)
-Yearly view.

I created my RRD database like this:
rrdtool create speed.rrd -s 10800 \
DS:local:GAUGE:86400:0:2500 \
DS:remote:GAUGE:86400:0:2500 \
RRA:AVERAGE:0.5:1:2928 \
RRA:AVERAGE:0.5:8:31 \
RRA:AVERAGE:0.5:56:5 \
RRA:AVERAGE:0.5:248:12 \
RRA:MIN:0.5:1:2928 \
RRA:MIN:0.5:8:31 \
RRA:MIN:0.5:56:5 \
RRA:MIN:0.5:248:12 \
RRA:MAX:0.5:1:2928 \
RRA:MAX:0.5:8:31 \
RRA:MAX:0.5:56:5 \
RRA:MAX:0.5:248:12

So I have the average, min and max value collected as follow:
data collected every 3 hours (10800 seconds)
for 1 year (2928 x 3 hours = 366 days)
sampled over 1 day (8 records) kept for 31 days
sampled over 1 week kept for 5 weeks
sampled over 1 month kept for 12 month.

Now to generate my graph, I use the following command:
/usr/local/rrdtool-1.2.27/bin/rrdtool graph images/localday.png -l 0 \
-t 'Australia Transfer - DAILY' \
--step 10800 -x HOUR:1:HOUR:3:HOUR:3:0:%k \
DEF:local=speed.rrd:local:AVERAGE DEF:remote=speed.rrd:remote:AVERAGE \
VDEF:ds0max=local,MAXIMUM \
    VDEF:ds0avg=local,AVERAGE \
    VDEF:ds0min=local,MINIMUM \
    VDEF:ds0pct=local,95,PERCENT \
    VDEF:ds1max=remote,MAXIMUM \
    VDEF:ds1avg=remote,AVERAGE \
    VDEF:ds1min=remote,MINIMUM \
    VDEF:ds1pct=remote,95,PERCENT \
 COMMENT:'            ' \
 COMMENT:'Maximum   ' \
    COMMENT:'Average   ' \
    COMMENT:'Minimum  '  \
    COMMENT:'95th percentile\l' \
    LINE1:local#00C000:'Australia ' \
    GPRINT:ds0max:'%5.0lf kb/s' \
    GPRINT:ds0avg:'%5.0lf kb/s' \
    GPRINT:ds0min:'%5.0lf kb/s' \
    GPRINT:ds0pct:'  %5.0lf kb/s\l' \
    LINE1:remote#0000FF:'USA' \
    GPRINT:ds1max:'%5.0lf kb/s' \
    GPRINT:ds1avg:'%5.0lf kb/s' \
    GPRINT:ds1min:'%5.0lf kb/s' \
    GPRINT:ds1pct:'  %5.0lf kb/s\l'

Unfortunately, this doesn't seem to work properly.
For a start I recorded the maximum and minimum value aren't correct,
they are rounded.
Like the maximum in my case should be 1267.13 but it shows as 1266 on the graph.
rrdtool fetch speed.rrd AVERAGE
timestamp    local             remote

1205895600:  1.2642200000e+03  1.6115000000e+02
1205906400:  1.2642200000e+03  1.6115000000e+02
1205917200:  1.2642200000e+03  1.6115000000e+02
1205928000:  1.2642200000e+03  1.6115000000e+02
1205938800:  1.2642200000e+03  1.6115000000e+02
1205949600:  1.2642200000e+03  1.6115000000e+02
1205960400:  1.2642200000e+03  1.6115000000e+02
1205971200:  1.2661600000e+03  1.6115666667e+02
1205982000:  nan  nan
1205992800:  nan  nan

I ran manually the command:
rrdtool update /var/www/html/adslstats/speed.rrd 1205974800:1267.13:161.16

so where is my 1267.13 ??

Then, in the graph itself, the line stop at what is 11AM.

Did I miss anything in the create of the round robin database? Did I
just misunderstand something in the documentation (I did read it over
and over to make sure I didn't make a stupid mistake).

Your help will be appreciated.

This is the page I am generating:
http://htpc.avenard.org/adsl/

For the data sampled every minute, it works just fine, only the data
sampled every 3 hours give me issues .

Cheers
Jean-Yves



More information about the rrd-users mailing list