<br><br><div class="gmail_quote">On Feb 20, 2008 10:56 AM, Alex van den Bogaerdt <<a href="mailto:alex@ergens.op.het.net">alex@ergens.op.het.net</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="Wj3C7c">On Wed, Feb 20, 2008 at 08:36:00AM -0700, Matthew Tice wrote:<br>> Hello, I'm wondering if it is possible to print a variable in the COMMENT:<br>> field. I have a setup like this:<br>
> TITLE Freezer Temperature<br>> YAXIS Degrees Kelvin<br>> DEF:tl=freezer.rrd:freezerf:AVERAGE<br>> CDEF:k2c=tl,273.15,-<br>> AREA:tl#@COLOR@:Temperature<br>> COMMENT:\n<br>
> GPRINT:tl:LAST:Temperature\: %2.1lf (cur)<br>> GPRINT:tl:MAX:\: %2.1lf (max)<br>> GPRINT:tl:MIN:\: %2.1lf (min)<br>> GPRINT:tl:AVERAGE:\: %2.1lf (avg)\n<br>><br>><br>> I'd like to take that variable k2c and print it's value on the COMMENT<br>
> line. Is this at all possible?<br><br><br></div></div>k2c is not really a variable, it is more like an array of variables.<br>You would need a print statement (such as those for tl) anyway.<br><br>And now the answer: yes, it is possible, but not from rrdtool itself.<br>
<br><br>Consider:<br><div class="Ih2E3d"><br> DEF:tl=freezer.rrd:freezerf:AVERAGE<br> CDEF:k2c=tl,273.15,-<br></div> PRINT:k2c:AVERAGE:%2.1lf<br><br>called from a script. This script catches the output, into a<br>
variable, and uses that in the next RRDtool command:<br><div class="Ih2E3d"><br> DEF:tl=freezer.rrd:freezerf:AVERAGE<br> CDEF:k2c=tl,273.15,-<br> AREA:tl#@COLOR@:Temperature<br></div> COMMENT:${YOURVARGOESHERE}\n<br>
<div class="Ih2E3d"> GPRINT:tl:LAST:Temperature\: %2.1lf (cur)<br> GPRINT:tl:MAX:\: %2.1lf (max)<br> GPRINT:tl:MIN:\: %2.1lf (min)<br> GPRINT:tl:AVERAGE:\: %2.1lf (avg)\n<br><br></div>If this means it is possible _for_you_ in _your_ setup, I cannot tell.<br>
But it is possible.<br><font color="#888888"><br>--</font></blockquote></div><br>Okay, thanks Alex - that's what I was looking for.<br><br>Matt<br>