3
# DigiTemp RRD logging script
4
# Copyright 1997-2002 by Brian C. Lane <bcl@brianlane.com> www.brianlane.com
7
# This program is free software; you can redistribute it and/or modify it
8
# under the terms of the GNU General Public License as published by the Free
9
# Software Foundation; either version 2 of the License, or (at your option)
12
# This program is distributed in the hope that it will be useful, but WITHOUT
13
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
17
# You should have received a copy of the GNU General Public License along
18
# with this program; if not, write to the Free Software Foundation, Inc.,
19
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
22
# Call this from crontab every 5 minutes. Make sure the .digitemprc is in
23
# your root directory or specify the configuration file using -c filename
24
# on the digitemp command line in the reading variable below.
26
# Get the current temperatures, digitemp has been previously initalized with
27
# digitemp -i -s /dev/ttyS0 -o2 -a
29
# Run it in quiet mode, output is 0\tsensor#1\tsensor#2\tsensor#3
30
reading=`/usr/local/bin/digitemp -a -q`
33
room=`echo $reading | gawk '{print $2}'`
34
attic=`echo $reading | gawk '{print $3}'`
35
drink=`echo $reading | gawk '{print $4}'`
38
/usr/local/rrdtool/bin/rrdtool update /root/rrdb/digitemp.rrd N:$room:$drink:$attic