init III
This commit is contained in:
150
Perl Luftdaten/31386_31387/write_graph.sh
Normal file
150
Perl Luftdaten/31386_31387/write_graph.sh
Normal file
@@ -0,0 +1,150 @@
|
||||
#!/bin/bash
|
||||
|
||||
function graph () {
|
||||
rrdtool graph "graph-$VALUE-$SPAN.png" \
|
||||
--title "$VALUE ($SPAN)" \
|
||||
--vertical-label "$UNIT" \
|
||||
--width '600' \
|
||||
--height '200' \
|
||||
--start end-$SPAN \
|
||||
"DEF:VNAME=db_31386_31387.rrd:$VALUE:MAX" \
|
||||
'VDEF:vmin=VNAME,MINIMUM' \
|
||||
'VDEF:vmax=VNAME,MAXIMUM' \
|
||||
'VDEF:vavg=VNAME,AVERAGE' \
|
||||
'VDEF:vlast=VNAME,LAST' \
|
||||
'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/31386_31387/
|
||||
|
||||
export SPAN=1h
|
||||
|
||||
export VALUE=Humidity
|
||||
export UNIT=%
|
||||
graph
|
||||
|
||||
export VALUE=Temperature
|
||||
export UNIT=°C
|
||||
graph
|
||||
|
||||
export VALUE=PM10
|
||||
export UNIT=µg
|
||||
graph
|
||||
|
||||
export VALUE=PM25
|
||||
graph
|
||||
|
||||
export VALUE=hPa
|
||||
export UNIT=hPa
|
||||
graph
|
||||
|
||||
|
||||
|
||||
|
||||
export SPAN=1d
|
||||
|
||||
export VALUE=Humidity
|
||||
export UNIT=%
|
||||
graph
|
||||
|
||||
export VALUE=Temperature
|
||||
export UNIT=°C
|
||||
graph
|
||||
|
||||
export VALUE=PM10
|
||||
export UNIT=µg
|
||||
graph
|
||||
|
||||
export VALUE=PM25
|
||||
graph
|
||||
|
||||
export VALUE=hPa
|
||||
export UNIT=hPa
|
||||
graph
|
||||
|
||||
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
|
||||
|
||||
export VALUE=Temperature
|
||||
export UNIT=°C
|
||||
graph
|
||||
|
||||
export VALUE=PM10
|
||||
export UNIT=µg
|
||||
graph
|
||||
|
||||
export VALUE=PM25
|
||||
graph
|
||||
|
||||
export VALUE=hPa
|
||||
export UNIT=hPa
|
||||
graph
|
||||
|
||||
|
||||
|
||||
|
||||
export SPAN=1m
|
||||
|
||||
export VALUE=Humidity
|
||||
export UNIT=%
|
||||
graph
|
||||
|
||||
export VALUE=Temperature
|
||||
export UNIT=°C
|
||||
graph
|
||||
|
||||
export VALUE=PM10
|
||||
export UNIT=µg
|
||||
graph
|
||||
|
||||
export VALUE=PM25
|
||||
graph
|
||||
|
||||
export VALUE=hPa
|
||||
export UNIT=hPa
|
||||
graph
|
||||
|
||||
|
||||
|
||||
|
||||
export SPAN=1y
|
||||
|
||||
export VALUE=Humidity
|
||||
export UNIT=%
|
||||
graph
|
||||
|
||||
export VALUE=Temperature
|
||||
export UNIT=°C
|
||||
graph
|
||||
|
||||
export VALUE=PM10
|
||||
export UNIT=µg
|
||||
graph
|
||||
|
||||
export VALUE=PM25
|
||||
graph
|
||||
|
||||
export VALUE=hPa
|
||||
export UNIT=hPa
|
||||
graph
|
||||
Reference in New Issue
Block a user