[rrd-users] Revisited Re: TOTAL function over small time periods

Alex van den Bogaerdt alex at ergens.op.het.net
Mon Sep 19 13:08:45 MEST 2005

On Thu, Sep 15, 2005 at 02:47:23PM +0200, Chris Picton wrote:

> I have a data source where I am incrementing a COUNTER rrd by one
> whenever an event occurs.
> I want to plot a graph of number of occurrences per
> (hour/day/month/etc).
> I had thought that the TOTAL function would be of help here, but am
> having problems.
> My command looks like:

[edit: reordered commands for clarity]

> rrdtool graph file.png -a PNG -w 512 -h 128 \
>  -s "1125525600" -e "1128117600" \
>  -x "DAY:1:WEEK:1:WEEK:1:86400:%d %b" \
>  -v "events" -l 0 \
>  "DEF:e0=file.rrd:event:AVERAGE:start=1125525600+0d:end=1125525600+1d" \
>  "DEF:e1=file.rrd:event:AVERAGE:start=1125525600+1d:end=1125525600+2d" \
>  "DEF:e2=file.rrd:event:AVERAGE:start=1125525600+2d:end=1125525600+3d" \
>  "DEF:e3=file.rrd:event:AVERAGE:start=1125525600+3d:end=1125525600+4d" \
>  "VDEF:t0=e0,TOTAL" \
>  "VDEF:t1=e1,TOTAL" \
>  "VDEF:t2=e2,TOTAL" \
>  "VDEF:t3=e3,TOTAL" \
>  "LINE:t0#FF0000" \
>  "LINE:t1#FF0000" \ 
>  "LINE:t2#FF0000" \ 
>  "LINE:t0#FF0000" \ 
>  etc etc
> However, each timeslice is not being shown separately - I am getting 30
> horizontal lines across the entire graph as opposed to just during the
> relevant time period.

I gave a totally wrong answer the first time.  Sorry for that.

It is not the DEF where things go wrong.  You are using LINE and VDEF
together.  A VDEF has no concept of time range.  It is either a value
or a time (not a time range).  You are using a VDEF with a value part
and are graphing that.  As a result, the value will be graphed from
left to right over the entire period of the graph.

Try this:

You have many unknowns in time ranges in e0, e1, e2 etc.
You have the desired values in t0, t1, t2, t3 etc.
If data is not unknown, replace it with t0, t1, t2 etc:


This will generate y0, a time series, filled with either UNKN or t0 depending
on e0 being unknown or not.

Please let me know if it works.

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://lists.ee.ethz.ch/rrd-users
WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi

More information about the rrd-users mailing list