Hello,
I have problem with data volume in the database.
Why not developp an RRD backend??
Is there anybody who already try this??
Thx.
Ughy.
Archived Forum |
|
RRD backend?Submitted by Ughy on Wed, 01/05/2013 - 20:14Hello, I have problem with data volume in the database. Why not developp an RRD backend?? Is there anybody who already try this?? Thx. Ughy. » |
Re: RRD backend?
You'll find matches if you search RRD or RRDTool on the forum.
Perhaps could emoncms be modified to allow for the deletion of feeds after a certain amount of time.
Re: RRD backend?
For now, I just hack rapidly /var/www/emoncms/Modules/raspberrypi/raspberrypi_run.php
# foreach ($tmp as $i) $process->input($time,$i['value'],$i['processList']);
if (rrd_update("/var/www/emoncms/test.rrd", array($valuestring) ) ) {
echo "OK\n" ;
}
else {
echo "KO\n" ;
}
I create the rrd with something like:
rrdtool create edf.rrd --step 5 DS:total:GAUGE:60:0:20000 DS:eau_chaude:GAUGE:60:0:20000 DS:chauffage:GAUGE:60:0:20000 RRA:AVERAGE:0.5:1:518400 RRA:AVERA
GE:0.5:12:525600 RRA:AVERAGE:0.5:60:315360
And a first graph:
/usr/bin/rrdtool graph test.png \
-w 785 -h 120 -a PNG \
--slope-mode \
--start -86400 --end now \
--font DEFAULT:7: \
--title "Consommation Electrique" \
--watermark "`date`" \
--vertical-label "Watts" \
--right-axis-label "Watts" \
--lower-limit 0 \
--right-axis 1:0 \
--x-grid MINUTE:10:HOUR:1:MINUTE:120:0:%R \
--alt-y-grid --rigid \
DEF:total=edf.rrd:total:AVERAGE \
DEF:eau_chaude=edf.rrd:eau_chaude:AVERAGE \
DEF:chauffage=edf.rrd:chauffage:AVERAGE \
LINE1:total#0000FF:"Total (Watts)" \
LINE1:eau_chaude#00FF00:"Eau Chaude (Watts)" \
LINE1:chauffage#FF0000:"Chauffage (Watts)"
The first result is very good. I think I will use Cacti as frontend to graph the RRD...
Next step:
- better modification of "raspberrypi_run.php" (I need to well understand all the line of these scripts)
- integration with Cacti...
++
Ughy.
Re: RRD backend?
You may want to have a look at the python gateway script as well, especially if you feel more comfortable with python. Maybe we could integrate that as a command line option (I could give a hand).
AFAIU, the script just needs to launch command rrd_update to create/modify a file (in your case /var/www/emoncms/test.rrd). Then all the post-processing is done via rrd command lines that can be run on demand or through cron.
Is this correct ?
Re: RRD backend?
Hi,
I use RRD, see the picture, I have been meaning to write up a wiki page, but couldn't even work out how to create a wiki page and haven't had the time.
If there is interest I will find some time to write it up.
Matt