<br><br><div class="gmail_quote">On Feb 20, 2008 10:56 AM, Alex van den Bogaerdt &lt;<a href="mailto:alex@ergens.op.het.net">alex@ergens.op.het.net</a>&gt; 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>&gt; Hello, I&#39;m wondering if it is possible to print a variable in the COMMENT:<br>&gt; field. &nbsp;I have a setup like this:<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp;TITLE Freezer Temperature<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp;YAXIS Degrees Kelvin<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp;DEF:tl=freezer.rrd:freezerf:AVERAGE<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp;CDEF:k2c=tl,273.15,-<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp;AREA:tl#@COLOR@:Temperature<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp;COMMENT:\n<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp;GPRINT:tl:LAST:Temperature\: %2.1lf (cur)<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp;GPRINT:tl:MAX:\: %2.1lf (max)<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp;GPRINT:tl:MIN:\: %2.1lf (min)<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp;GPRINT:tl:AVERAGE:\: %2.1lf (avg)\n<br>&gt;<br>&gt;<br>&gt; I&#39;d like to take that variable k2c and print it&#39;s value on the COMMENT<br>
&gt; line. &nbsp;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> &nbsp; &nbsp; &nbsp; &nbsp;DEF:tl=freezer.rrd:freezerf:AVERAGE<br> &nbsp; &nbsp; &nbsp; &nbsp;CDEF:k2c=tl,273.15,-<br></div> &nbsp; &nbsp; &nbsp; &nbsp;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> &nbsp; &nbsp; &nbsp; &nbsp;DEF:tl=freezer.rrd:freezerf:AVERAGE<br> &nbsp; &nbsp; &nbsp; &nbsp;CDEF:k2c=tl,273.15,-<br> &nbsp; &nbsp; &nbsp; &nbsp;AREA:tl#@COLOR@:Temperature<br></div> &nbsp; &nbsp; &nbsp; &nbsp;COMMENT:${YOURVARGOESHERE}\n<br>
<div class="Ih2E3d"> &nbsp; &nbsp; &nbsp; &nbsp;GPRINT:tl:LAST:Temperature\: %2.1lf (cur)<br> &nbsp; &nbsp; &nbsp; &nbsp;GPRINT:tl:MAX:\: %2.1lf (max)<br> &nbsp; &nbsp; &nbsp; &nbsp;GPRINT:tl:MIN:\: %2.1lf (min)<br> &nbsp; &nbsp; &nbsp; &nbsp;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&#39;s what I was looking for.<br><br>Matt<br>