Skip to content

Instantly share code, notes, and snippets.

@stwalkerster
Created July 31, 2013 21:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stwalkerster/6126356 to your computer and use it in GitHub Desktop.
Save stwalkerster/6126356 to your computer and use it in GitHub Desktop.
#!/bin/bash
cd /root
DATA=`./temphumid 4`
old=$IFS
IFS='
'
val="N"
for x in $DATA; do
val=$val":"$x
done
# echo $val
# rrdtool create environment.rrd --start `date +%s` --step 300 \
# DS:temp:GAUGE:600:0:U \
# DS:humid:GAUGE:600:0:U \
# RRA:AVERAGE:0.5:1:288 \
# RRA:AVERAGE:0.5:3:672 \
# RRA:AVERAGE:0.5:12:744 \
# RRA:AVERAGE:0.5:72:1480
rrdtool update environment.rrd $val
IFS=$old
rrdtool graph /var/www/th.png -u 100 -l 0 -w 800 -h 300 -s `date -d -1day +%s` -e `date +%s` --title "Temperature and Humidity (last day)" "DEF:temp=environment.rrd:temp:AVERAGE" "DEF:tempyesterda$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment