Skip to content

Instantly share code, notes, and snippets.

@filipsPL
Created April 12, 2016 12:04
Show Gist options
  • Save filipsPL/4d340976e3f69e135c4f3a2784e9a992 to your computer and use it in GitHub Desktop.
Save filipsPL/4d340976e3f69e135c4f3a2784e9a992 to your computer and use it in GitHub Desktop.
#!/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