Commit 8aaf7aff authored by julric's avatar julric

new shell script to create RRD

parent 99c7c1b3
#!/bin/bash
if [ $# -eq 0 ]
then
echo -e "\nThis script generates a blank rrd with 8 datasources (tempbmp,tempdht,press,humi,light,no2,co,vol).\nFor more information please open this script in Your favorite editor.\n\nUsage:\t ./create_rrd.sh rrd_file_name.rrd\n\ne.g.:\t ./create_rrd.sh /srv/airpi/data_airpi.rrd\n"
else
# edit Your settings here, if You need another kind of rrd, e.g. another timestep
#
# if You want to add more datasources (sensors),
# just insert "DS:smoke:GAUGE:180:U:U \" (without ")
# as a new line after the last DS (line 18) and change
# "smoke" to the sensor-name You want.
#
rrdtool create $1 --step=120 \
DS:tempbmp:GAUGE:180:-273:5000 \
DS:tempdht:GAUGE:180:-273:5000 \
DS:press:GAUGE:180:U:U \
DS:humi:GAUGE:180:U:U \
DS:light:GAUGE:180:U:U \
DS:no2:GAUGE:180:U:U \
DS:co:GAUGE:180:U:U \
DS:vol:GAUGE:180:U:U \
RRA:AVERAGE:0.5:1:3200 \
RRA:AVERAGE:0.5:6:3200 \
RRA:AVERAGE:0.5:36:3200 \
RRA:AVERAGE:0.5:144:3200 \
RRA:AVERAGE:0.5:1008:3200 \
RRA:AVERAGE:0.5:4320:3200 \
RRA:AVERAGE:0.5:52560:3200 \
RRA:AVERAGE:0.5:525600:3200 \
RRA:MIN:0.5:1:3200 \
RRA:MIN:0.5:6:3200 \
RRA:MIN:0.5:36:3200 \
RRA:MIN:0.5:144:3200 \
RRA:MIN:0.5:1008:3200 \
RRA:MIN:0.5:4320:3200 \
RRA:MIN:0.5:52560:3200 \
RRA:MIN:0.5:525600:3200 \
RRA:MAX:0.5:1:3200 \
RRA:MAX:0.5:6:3200 \
RRA:MAX:0.5:36:3200 \
RRA:MAX:0.5:144:3200 \
RRA:MAX:0.5:1008:3200 \
RRA:MAX:0.5:4320:3200 \
RRA:MAX:0.5:52560:3200 \
RRA:MAX:0.5:525600:3200
if [ -f $1 ]
then
echo -e "\nRRD '$1' successfully generated.\n"
else
echo -e "\nSomething went wrong.\n"
fi
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment