[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
graph positive and negative values
- To: hobbit (at) hswn.dk
- Subject: graph positive and negative values
- From: "Matthew Tice" <mjtice (at) gmail.com>
- Date: Tue, 19 Feb 2008 20:05:22 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; bh=X8STFNLM5+Ca1KW5OFF5F2JvScBPMyMwmPjKWU3ZSOA=; b=S67q62ENEkb4uwXjYYlLaArvXBj1cBY9h/t6610sJWGVVt3cm/r1INEUmJxX41dAP8QDMcuiUjQK9n0qpip1G5KKOXSuaZT1tP90BiKeV0GIdCIepbwKn5xjLjMZ5fNsR1P/OR2SodyzD/RC3zUNqzr+tLaXnStOp5RrnqCwAcI=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=rhBY7aInav9ArT4+NLOoNeDou0dSGBpCzqc1Ttzde30cGi3a3G4Kw0lQbNAhhMZdX/VMezh/6IhYrkMfEfjuJcgPz6qc5dr1kI3/Ah7lrTiIvfQhuI49WBljq9bzlUbgMSzqtPP62RYTlnjiux4JHlDI3joowLMUL5UnraLLLmQ=
Hi, I'm wondering if anyone has been successful setting up and graphing an
item that fluctuates between positive and negative values? I'm trying to
trend the temperature of my freezer. When I created the rrd earlier today
(when positive values were generated) the graph was functional. When I put
my sensors inside the freezer (where the temperatures drop a few degrees
below zero F) the values wouldn't drop below zero on the graph.
I tried modifying the current rrd tool with:
rrdtool tune /home/hobbit/data/rrd/tice/freezer.rrd --minimum freezerf:U
(which did drop the minimum to nan) but I still couldn't get negatives to
show on the graph. I thought I'd delete the rrd and start over - but I
think now that the values are negative numbers the rrd won't even create.
Here is a snippet from my hobbitgraph and hobbitserver files
[freezer]
TITLE Freezer Temperature
YAXIS Degrees
DEF:tl=freezer.rrd:freezerf:AVERAGE
#CDEF:wipeoutf=tl,-1,*
DEF:cel=freezer.rrd:freezerc:AVERAGE
#CDEF:wipeoutc=cel,-1,*
LINE2:tl# (at) COLOR@:Temperature F
#LINE2:wipeoutf# (at) COLOR@:Temperature -F
LINE2:cel# (at) COLOR@:Temperature C
#LINE2:wipeoutc# (at) COLOR@:Temperature -C
COMMENT:\n
GPRINT:tl:LAST:Temperature F\: %2.1lf (cur)
GPRINT:tl:MAX:\: %2.1lf (max)
GPRINT:tl:MIN:\: %2.1lf (min)
GPRINT:tl:AVERAGE:\: %2.1lf (avg)\n
GPRINT:cel:LAST:Temperature C\: %2.1lf (cur)
GPRINT:cel:MAX:\: %2.1lf (max)
GPRINT:cel:MIN:\: %2.1lf (min)
GPRINT:cel:AVERAGE:\: %2.1lf (avg)\n
NCV_freezer="*:GAUGE"
(with freezer=ncv at the end of TEST2RRD and freezer and the end of GRAPHS).
Here is my script that generates the NCV for the rrd:
#!/bin/sh
COLUMN=freezer # Name of the column
COLOR=green # By default, everything is OK
[ -f ./.digitemprc ] || /usr/local/bin/digitemp_DS9097U -s/dev/ttyS0 -i
TEMPERATURE=$(/usr/local/bin/digitemp_DS9097U -s/dev/ttyS0 -a | awk '{print
$9}' | tail -1 | awk -F. '{print $1}')
if [ "${TEMPERATURE}" -gt 30 ]; then
COLOR=red
MSG="Temperature above 30 degrees"
else
COLOR=green
MSG="Temperature normal"
fi
# Section for data graphing
TEMPERATURE2_F=$(/usr/local/bin/digitemp_DS9097U -s/dev/ttyS0 -a | awk
'{print $9}' | tail -1)
TEMPERATURE2_C=$(/usr/local/bin/digitemp_DS9097U -s/dev/ttyS0 -a | awk
'{print $7}' | tail -1)
echo "freezerf : ${TEMPERATURE2_F}" > $BBTMP/freezer_f.txt
echo "freezerc : ${TEMPERATURE2_C}" > $BBTMP/freezer_c.txt
##
$BB $BBDISP "status $MACHINE.freezer $COLOR $MSG
`cat $BBTMP/freezer_f.txt`
`cat $BBTMP/freezer_c.txt`
"
rm $BBTMP/freezer_f.txt
rm $BBTMP/freezer_c.txt
exit 0
If anyone has an idea please let me know - I'd really like to trend this
data.
Thanks,
Matt