RRD Database Creation

From Bright Things Wiki
Jump to: navigation, search

Data

Sensor data is stored in a round-robin database.

Creating Database

The following database will expect an update every second, and store the following data:

  • average, min and max 1 second samples for 1 hour
  • average, min and max 60 second samples for 31 days
  • average, min and max 1 hour samples for 1 year
rrdtool create pp.rrd \
--step 1 \
DS:rp0:GAUGE:2:0:10000 \
DS:ap0:GAUGE:2:0:10000 \
DS:pf0:GAUGE:2:-100:100 \
DS:vr0:GAUGE:2:0:10000 \
DS:ir0:GAUGE:2:0:10000 \
DS:rp1:GAUGE:2:0:10000 \
DS:ap1:GAUGE:2:0:10000 \
DS:pf1:GAUGE:2:-100:100 \
DS:vr1:GAUGE:2:0:10000 \
DS:ir1:GAUGE:2:0:10000 \
DS:rp2:GAUGE:2:0:10000 \
DS:ap2:GAUGE:2:0:10000 \
DS:pf2:GAUGE:2:-100:100 \
DS:vr2:GAUGE:2:0:10000 \
DS:ir2:GAUGE:2:0:10000 \
RRA:MIN:0.5:1:86400 \
RRA:AVERAGE:0.5:1:86400 \
RRA:MAX:0.5:1:86400 \
RRA:MIN:0.5:60:44640 \
RRA:AVERAGE:0.5:60:44640 \
RRA:MAX:0.5:60:44640 \
RRA:MIN:0.5:3600:8760 \
RRA:AVERAGE:0.5:3600:8760 \
RRA:MAX:0.5:3600:8760

Temperature Database

The following database will expect an update every minute, and store the following data:

  • average, min and max 1 minute samples for 48 hours
  • average, min and max 1 hour samples for 60 days
  • average, min and max 1 day samples for 5 years
rrdtool create temp.rrd \
--step 60 \
DS:temp:GAUGE:5:-300:300 \
RRA:MIN:0.5:1:2880 \
RRA:AVERAGE:0.5:1:2880 \
RRA:MAX:0.5:1:2880 \
RRA:MIN:0.5:60:1560 \
RRA:AVERAGE:0.5:60:1560 \
RRA:MAX:0.5:60:1560 \
RRA:MIN:0.5:1440:1825 \
RRA:AVERAGE:0.5:1440:1825 \
RRA:MAX:0.5:1440:1825

System Performance Database

rrdtool create system.rrd \
--step 60 \
DS:load:GAUGE:2:0:500 \
RRA:AVERAGE:0.5:1:525600 \
RRA:AVERAGE:0.5:5:525600 \
RRA:AVERAGE:0.5:15:525600