Skip to content

Instantly share code, notes, and snippets.

@stwalkerster
Created Jul 31, 2013
Embed
What would you like to do?
#!/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