[rrd-users] Can you use the graphed time interval in a CDEF function?

A Darren Dunham ddunham at taos.com
Wed Nov 18 20:16:20 CET 2009


On Wed, Nov 18, 2009 at 12:02:33AM -0800, Marc MERLIN wrote:
> > I don't see why you'd want to depend on the time range of the graph.  If
> > your graph was 22 hours, wouldn't you still want to see Kwh/day and
> > therefore still multiply by 24?
> 
> No. I might want to see a week's worth or a month's worth or whatever range
> I zoomed on.
> For instance how much electricity did I use in august, or how much AC did I
> use last week.

Okay, so you want to compute cumulative engery usage.  I think I was
thinking you just wanted to scale the units.  

> > If you do want the time range, I think you'd have to graph something
> > twice.  The first one doesn't have to have all the data, but you can get
> > the range info from it with graphv.  Then use that information to create
> > the second graph.
> 
> I'm not familiar with graphv, but can I do it on a dynamic basis based on
> the range I just selected to render as a rrdtool graph with cacti or from
> the command line?

Yes.  Use 'graphv' instead of 'graph', and it returns details about the
graph, including the 'start' and 'end' times.  So you might have to
graph twice.  Once to get the times, then again after you have that
information.  

-- 
Darren



More information about the rrd-users mailing list