Created
April 12, 2016 12:04
-
-
Save filipsPL/4d340976e3f69e135c4f3a2784e9a992 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DATA=`date` | |
DIR=/usr/local/bin/rrd/pi/rrd/ | |
OUTDIR=/var/www/pi/sysinfo/img/ | |
BAZA=$DIR/temperatura.rrd | |
var=cisnienie | |
# ----------------------------------------------------------------------------------------- | |
okresy="24h 7d 1m 1y" | |
for okres in $okresy | |
do | |
# --lazy\ | |
rrdtool graph $OUTDIR/$var-$okres.png \ | |
--imgformat PNG \ | |
--start "now-$okres" \ | |
--title="Ciśnienie [hPa] -$okres | $DATA" \ | |
--height 240 \ | |
--width 420 \ | |
--alt-autoscale \ | |
--alt-y-grid \ | |
--lazy\ | |
--slope-mode \ | |
DEF:p=$BAZA:p:AVERAGE \ | |
DEF:pmin=$BAZA:p:MIN \ | |
DEF:pmax=$BAZA:p:MAX \ | |
LINE2:p#CC00CC:"P"\ | |
LINE0.7:pmin#D3D3D3:"min"\ | |
LINE0.7:pmax#D3D3D3:"max"\ | |
GPRINT:p:LAST:"%3.1lf"\ | |
GPRINT:pmin:MIN:"| min %3.1lf"\ | |
GPRINT:pmax:MAX:"| max %3.1lf"\ | |
GPRINT:p:AVERAGE:"| śr %3.1lf\n" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment