draw_rrd_month.sh 5.41 KB
Newer Older
julric's avatar
julric committed
1 2 3
#! /bin/bash

RRDTOOL="/usr/bin/rrdtool"
4
RRD_DB="../data_airpi.rrd"
julric's avatar
julric committed
5

6
GRAPH_PATH="../graph"
julric's avatar
julric committed
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129


$RRDTOOL graph $GRAPH_PATH/airpi-tempbmp-month.png -a PNG --width=800 --height=300 \
--start -1m --pango-markup --vertical-label 'Temperatur (°C)' --upper-limit 40 --lower-limit 0 \
DEF:temp=$RRD_DB:tempbmp:AVERAGE \
DEF:tempmin=$RRD_DB:tempbmp:MIN \
DEF:tempmax=$RRD_DB:tempbmp:MAX \
AREA:temp#acc6fb \
LINE1:temp#4f5a72:"<big>Temperatur (BMP085)</big>  " \
VDEF:temp_min=temp,MINIMUM \
'GPRINT:temp_min:<b>Minimum</b>\: %5.0lf °C  ' \
VDEF:temp_average=temp,AVERAGE \
'GPRINT:temp_average:<b>Durchschnitt</b>\: %5.0lf °C  ' \
VDEF:temp_max=temp,MAXIMUM \
'GPRINT:temp_max:<b>Maximum</b>\: %5.0lf °C  ' \
> /dev/null

$RRDTOOL graph $GRAPH_PATH/airpi-tempdht-month.png -a PNG --width=800 --height=300 \
--start -1m --pango-markup --vertical-label 'Temperatur (°C)' --upper-limit 40 --lower-limit 0 \
DEF:temp=$RRD_DB:tempdht:AVERAGE \
DEF:tempmin=$RRD_DB:tempdht:MIN \
DEF:tempmax=$RRD_DB:tempdht:MAX \
AREA:temp#acc6fb \
LINE1:temp#4f5a72:"<big>Temperatur (DHT22)</big>  " \
VDEF:temp_min=temp,MINIMUM \
'GPRINT:temp_min:<b>Minimum</b>\: %5.0lf °C  ' \
VDEF:temp_average=temp,AVERAGE \
'GPRINT:temp_average:<b>Durchschnitt</b>\: %5.0lf °C  ' \
VDEF:temp_max=temp,MAXIMUM \
'GPRINT:temp_max:<b>Maximum</b>\: %5.0lf °C  ' \
> /dev/null

$RRDTOOL graph $GRAPH_PATH/airpi-press-month.png -a PNG --width=800 --height=300 --lower-limit 940 \
--start -1m --pango-markup --vertical-label 'Druck (hPa)' --upper-limit 1060 --rigid --units-exponent 0 \
DEF:press=$RRD_DB:press:AVERAGE \
DEF:pressmin=$RRD_DB:press:MIN \
DEF:pressmax=$RRD_DB:press:MAX \
AREA:press#acc6fb \
LINE1:press#4f5a72:"<big>Druck (BMP085)</big>  " \
VDEF:press_min=press,MINIMUM \
'GPRINT:press_min:<b>Minimum</b>\: %5.0lf hPa  ' \
VDEF:press_average=press,AVERAGE \
'GPRINT:press_average:<b>Durchschnitt</b>\: %5.0lf hPa  ' \
VDEF:press_max=press,MAXIMUM \
'GPRINT:press_max:<b>Maximum</b>\: %5.0lf hPa  ' \
> /dev/null

$RRDTOOL graph $GRAPH_PATH/airpi-humi-month.png -a PNG --width=800 --height=300 \
--start -1m --pango-markup --vertical-label 'Luftfeuchtigkeit (%)' --lower-limit 0 --upper-limit 100 \
DEF:humi=$RRD_DB:humi:AVERAGE \
DEF:humimin=$RRD_DB:humi:MIN \
DEF:humimax=$RRD_DB:humi:MAX \
AREA:humi#acc6fb \
LINE1:humi#4f5a72:"<big>Luftfeuchtigkeit (DHT22)</big>  " \
VDEF:humi_min=humi,MINIMUM \
'GPRINT:humi_min:<b>Minimum</b>\: %5.0lf  %% ' \
VDEF:humi_average=humi,AVERAGE \
'GPRINT:humi_average:<b>Durchschnitt</b>\: %5.0lf  %% ' \
VDEF:humi_max=humi,MAXIMUM \
'GPRINT:humi_max:<b>Maximum</b>\: %5.0lf  %% ' \
> /dev/null

$RRDTOOL graph $GRAPH_PATH/airpi-light-month.png -a PNG --width=800 --height=300 \
--start -1m --pango-markup --vertical-label 'Helligkeit (%)' --lower-limit 0 --upper-limit 110 \
DEF:light=$RRD_DB:light:AVERAGE \
DEF:lightmax=$RRD_DB:light:MAX \
CDEF:scaled_light=light,10250000,/ \
CDEF:light_inverse=1,scaled_light,- \
CDEF:light_percent=light_inverse,100,* \
AREA:light_percent#acc6fb \
LINE1:light_percent#4f5a72:"<big>Helligkeit (LDR)</big>  " \
VDEF:light_min=light_percent,MINIMUM \
'GPRINT:light_min:<b>Minimum</b>\: %5.0lf  %% ' \
VDEF:light_average=light_percent,AVERAGE \
'GPRINT:light_average:<b>Durchschnitt</b>\: %5.0lf  %% ' \
VDEF:light_max=light_percent,MAXIMUM \
'GPRINT:light_max:<b>Maximum</b>\: %5.0lf  %% ' \
> /dev/null

$RRDTOOL graph $GRAPH_PATH/airpi-no2-month.png -a PNG --width=800 --height=300 \
--start -1m --pango-markup --vertical-label 'Stickstoffdioxid' \
DEF:no2=$RRD_DB:no2:AVERAGE \
DEF:no2min=$RRD_DB:no2:MIN \
DEF:no2max=$RRD_DB:no2:MAX \
AREA:no2#acc6fb \
LINE1:no2#4f5a72:"<big>Stickstoffdioxid (MiCS-2710)</big>  " \
VDEF:no2_min=no2,MINIMUM \
'GPRINT:no2_min:<b>Minimum</b>\: %5.0lf   ' \
VDEF:no2_average=no2,AVERAGE \
'GPRINT:no2_average:<b>Durchschnitt</b>\: %5.0lf   ' \
VDEF:no2_max=no2,MAXIMUM \
'GPRINT:no2_max:<b>Maximum</b>\: %5.0lf   ' \
> /dev/null

$RRDTOOL graph $GRAPH_PATH/airpi-co-month.png -a PNG --width=800 --height=300 \
--start -1m --pango-markup --vertical-label 'Kohlenstoffmonoxid' \
DEF:co=$RRD_DB:co:AVERAGE \
DEF:comin=$RRD_DB:co:MIN \
DEF:comax=$RRD_DB:co:MAX \
AREA:co#acc6fb \
LINE1:co#4f5a72:"<big>Kohlenstoffmonoxid (MiCS-5525)</big>  " \
VDEF:co_min=co,MINIMUM \
'GPRINT:co_min:<b>Minimum</b>\: %5.0lf   ' \
VDEF:co_average=co,AVERAGE \
'GPRINT:co_average:<b>Durchschnitt</b>\: %5.0lf   ' \
VDEF:co_max=co,MAXIMUM \
'GPRINT:co_max:<b>Maximum</b>\: %5.0lf   ' \
> /dev/null

$RRDTOOL graph $GRAPH_PATH/airpi-vol-month.png -a PNG --width=800 --height=300 \
--start -1m --pango-markup --vertical-label 'Lautstärke' \
DEF:vol=$RRD_DB:vol:AVERAGE \
DEF:volmin=$RRD_DB:vol:MIN \
DEF:volmax=$RRD_DB:vol:MAX \
AREA:vol#acc6fb \
LINE1:vol#4f5a72:"<big>Lautstärke (ABM_713_RC)</big>  " \
VDEF:vol_min=vol,MINIMUM \
'GPRINT:vol_min:<b>Minimum</b>\: %5.0lf   ' \
VDEF:vol_average=vol,AVERAGE \
'GPRINT:vol_average:<b>Durchschnitt</b>\: %5.0lf   ' \
VDEF:vol_max=vol,MAXIMUM \
'GPRINT:vol_max:<b>Maximum</b>\: %5.0lf   ' \
> /dev/null
130 131 132 133 134 135 136 137 138 139 140 141 142

$RRDTOOL graph $GRAPH_PATH/airpi-smoke-month.png -a PNG --width=800 --height=300 \
--start -1m --pango-markup --vertical-label 'Luftverschmutzung' \
DEF:smoke=$RRD_DB:smoke:AVERAGE \
AREA:smoke#acc6fb \
LINE1:smoke#4f5a72:"<big>Luftverschmutzung (TGS2600)</big>  " \
VDEF:smoke_min=smoke,MINIMUM \
'GPRINT:smoke_min:<b>Minimum</b>\: %5.0lf   ' \
VDEF:smoke_average=smoke,AVERAGE \
'GPRINT:smoke_average:<b>Durchschnitt</b>\: %5.0lf   ' \
VDEF:smoke_max=smoke,MAXIMUM \
'GPRINT:smoke_max:<b>Maximum</b>\: %5.0lf   ' \
> /dev/null