<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Thanks Henrik, as usual your advice worked like a charm. I also
changed the GPRINT statements to use tempf so the legend would be
correct. Final version:<br>
<br>
<br>
[temperature]<br>
FNPATTERN temperature.(.*).rrd<br>
TITLE Temperature<br>
YAXIS Fahrenheit<br>
DEF:p@RRDIDX@=@RRDFN@:temperature:AVERAGE<br>
CDEF:tempf@RRDIDX@=9,5,/,p@RRDIDX@,*,32,+<br>
LINE2:tempf@RRDIDX@#@COLOR@:@RRDPARAM@<br>
GPRINT:tempf@RRDIDX@:LAST: \: %5.1lf (cur)<br>
GPRINT:tempf@RRDIDX@:MAX: \: %5.1lf (max)<br>
GPRINT:tempf@RRDIDX@:MIN: \: %5.1lf (min)<br>
GPRINT:tempf@RRDIDX@:AVERAGE: \: %5.1lf (avg)\n<br>
<br>
Thanks again!<br>
-Charles<br>
<br>
Henrik Stoerner wrote:
<blockquote cite="mid20050215195034.GA13989@hswn.dk" type="cite">
<pre wrap="">On Tue, Feb 15, 2005 at 11:49:55AM -0700, Charles Jones wrote:
</pre>
<blockquote type="cite">
<pre wrap="">1. How can I graph Farenheit instead of Celcius?
</pre>
</blockquote>
<pre wrap=""><!---->
The easiest way of doing that is to change the hobbitgraph.cfg
definition for the graph!
In the [temperature] section, there's this line that picks out the
"temperature" setting from the RRD file:
DEF:p@RRDIDX@=@RRDFN@:temperature:AVERAGE
This is an RRDtool "DEF" (definition) that defines a variable
"p@RRDIDX@" (the "@RRDIDX@" is handled by hobbitgraph, and is needed
because there are multiple graphs. So essentially you get p0, p1, p2
etc - one for each temperature*rrd file).
There's also something called a "CDEF" - a Computed DEFinition.
Meaning you can do math on the data you have in the RRD. So to compute
Fahrenheit, you do the usual F = (9/5)*C + 32 - using Reverse Polish
Notation (RPN) which is what CDEF's understand:
CDEF:tempf@RRDIDX@=9,5,/,p@RRDIDX@,*,32,+
Now you have two values: p@RRDIDX which is the original Celsius
temperature, and tempf@RRDIDX@ which is the Fahrenheit equivalent.
So to get the graph for the Fahrenheit one, change the LINE2 graph
definition to use the Fahrenheit value:
LINE2:tempf@RRDIDX@#@COLOR@:@RRDPARAM@
Finally you just change the Y-axis label, and end up with this
definition:
[temperature]
FNPATTERN temperature.(.*).rrd
TITLE Temperature
YAXIS Fahrenheit
DEF:p@RRDIDX@=@RRDFN@:temperature:AVERAGE
CDEF:tempf@RRDIDX@=9,5,/,p@RRDIDX@,*,32,+
LINE2:tempf@RRDIDX@#@COLOR@:@RRDPARAM@
GPRINT:p@RRDIDX@:LAST: \: %5.1lf (cur)
GPRINT:p@RRDIDX@:MAX: \: %5.1lf (max)
GPRINT:p@RRDIDX@:MIN: \: %5.1lf (min)
GPRINT:p@RRDIDX@:AVERAGE: \: %5.1lf (avg)\n
Untested, but you get the idea ... the RRDtool website has some more
examples and tutorials on CDEF's.
Regards,
Henrik
To unsubscribe from the hobbit list, send an e-mail to
<a class="moz-txt-link-abbreviated" href="mailto:hobbit-unsubscribe@hswn.dk">hobbit-unsubscribe@hswn.dk</a>
</pre>
</blockquote>
<br>
</body>
</html>