155 lines
2.1 KiB
Bash
155 lines
2.1 KiB
Bash
#!/bin/bash
|
|
|
|
function graph () {
|
|
# "DEF:VNAME1=db_761_762.rrd:$VALUE:AVERAGE:step=$1" \
|
|
|
|
rrdtool graph "graph-$VALUE-$SPAN.png" \
|
|
--title "$VALUE ($SPAN) red[$1s Average]" \
|
|
--vertical-label "$UNIT" \
|
|
--width '600' \
|
|
--height '200' \
|
|
--start end-$SPAN \
|
|
"DEF:VNAME=db_761_762.rrd:$VALUE:AVERAGE" \
|
|
"DEF:VNAME1=db_761_762.rrd:$VALUE:AVERAGE:step=$1" \
|
|
'VDEF:vmin=VNAME,MINIMUM' \
|
|
'VDEF:vmax=VNAME,MAXIMUM' \
|
|
'VDEF:vavg=VNAME,AVERAGE' \
|
|
'VDEF:vlast=VNAME,LAST' \
|
|
'LINE1:VNAME1#FF0000' \
|
|
'LINE1:VNAME#0000FF' \
|
|
'GPRINT:vmin:%3.1lf (min)' \
|
|
'GPRINT:vmax:%3.1lf (max)' \
|
|
'GPRINT:vavg:%3.1lf (avg)' \
|
|
'GPRINT:vlast:%3.1lf (last)'
|
|
}
|
|
|
|
cd /scripts/luftdaten/761_762/
|
|
|
|
export SPAN=1h
|
|
|
|
export VALUE=Humidity
|
|
export UNIT=%
|
|
graph 300
|
|
|
|
export VALUE=Temperature
|
|
export UNIT=°C
|
|
graph 300
|
|
|
|
export VALUE=PM10
|
|
export UNIT=µg
|
|
graph 300
|
|
|
|
export VALUE=PM25
|
|
graph 300
|
|
|
|
export VALUE=hPa
|
|
export UNIT=hPa
|
|
graph 300
|
|
|
|
|
|
|
|
|
|
export SPAN=1d
|
|
|
|
export VALUE=Humidity
|
|
export UNIT=%
|
|
graph 1800
|
|
|
|
export VALUE=Temperature
|
|
export UNIT=°C
|
|
graph 1800
|
|
|
|
export VALUE=PM10
|
|
export UNIT=µg
|
|
graph 1800
|
|
|
|
export VALUE=PM25
|
|
graph 1800
|
|
|
|
export VALUE=hPa
|
|
export UNIT=hPa
|
|
graph 1800
|
|
|
|
export TIM=`date +"%H:%M"`
|
|
if [ "$TIM" == "23:55" ]
|
|
then
|
|
export DAT=`date +"%Y-%m-%d"`
|
|
cp graph-Temperature-1d.png graph-Temperature-$DAT.png
|
|
cp graph-Humidity-1d.png graph-Humidity-$DAT.png
|
|
cp graph-hPa-1d.png graph-hPa-$DAT.png
|
|
cp graph-PM10-1d.png graph-PM10-$DAT.png
|
|
cp graph-PM25-1d.png graph-PM25-$DAT.png
|
|
fi
|
|
|
|
|
|
|
|
|
|
export SPAN=1w
|
|
|
|
export VALUE=Humidity
|
|
export UNIT=%
|
|
graph 3600
|
|
|
|
export VALUE=Temperature
|
|
export UNIT=°C
|
|
graph 3600
|
|
|
|
export VALUE=PM10
|
|
export UNIT=µg
|
|
graph 3600
|
|
|
|
export VALUE=PM25
|
|
graph 3600
|
|
|
|
export VALUE=hPa
|
|
export UNIT=hPa
|
|
graph 3600
|
|
|
|
|
|
|
|
|
|
export SPAN=1m
|
|
|
|
export VALUE=Humidity
|
|
export UNIT=%
|
|
graph 3600
|
|
|
|
export VALUE=Temperature
|
|
export UNIT=°C
|
|
graph 3600
|
|
|
|
export VALUE=PM10
|
|
export UNIT=µg
|
|
graph 3600
|
|
|
|
export VALUE=PM25
|
|
graph 3600
|
|
|
|
export VALUE=hPa
|
|
export UNIT=hPa
|
|
graph 3600
|
|
|
|
|
|
|
|
|
|
export SPAN=1y
|
|
|
|
export VALUE=Humidity
|
|
export UNIT=%
|
|
graph 86400
|
|
|
|
export VALUE=Temperature
|
|
export UNIT=°C
|
|
graph 86400
|
|
|
|
export VALUE=PM10
|
|
export UNIT=µg
|
|
graph 86400
|
|
|
|
export VALUE=PM25
|
|
graph 86400
|
|
|
|
export VALUE=hPa
|
|
export UNIT=hPa
|
|
graph 86400
|