[rrd-users] Accumulative power usage graph

gm_sjo saqmaster at gmail.com
Mon Feb 23 15:29:32 CET 2009


Thanks Rob. I'll take a good read through that soon.


For the meantime i've knocked up my graphs as follows :-

/usr/local/bin/rrdtool graph /var/www/htdocs/images/power_1d.png \
--watermark "SAQ POWER - 1 DAY" --start end-1day --width 1000 --height
100 --end now --slope-mode --vertical-label Watts --alt-autoscale \
DEF:Power=powertemp.rrd:Power:AVERAGE \
DEF:PowerMin=powertemp.rrd:Power:MIN \
DEF:PowerMax=powertemp.rrd:Power:MAX \
CDEF:PowerRange=PowerMax,PowerMin,- \
CDEF:kWh=Power,1000,/,24,* \
LINE1:PowerMin: \
AREA:PowerRange#0000FF11:"":STACK \
LINE1:PowerMin#0000FF33:"" \
LINE1:PowerMax#0000FF33:"" \
LINE1:Power#0000FF:"Average Consumption\:" \
GPRINT:Power:AVERAGE:"%4.0lf Watts" \
GPRINT:PowerMin:MIN:"[Min\:%4.0lfW" \
GPRINT:PowerMax:MAX:"Max\:%4.0lfW]" \
COMMENT:"[Units used\:" \
GPRINT:kWh:AVERAGE:"%1.2lf kWh]"


Now the '24' in CDEF:kWh is obviously hours but i'm wondering if there
is any variable containing the length of the graph, in seconds,
whatever. I did try playing with begintime but was probably
DoinItWrong(tm) and didnt' get very far. It'd be nice if I could have
a generic entry I can re-use without having to calculate the hours
myself.

Any thoughts?

Thanks!



More information about the rrd-users mailing list