<div dir="ltr">Hello Steve,<div>Thanks a lot! Yes, this trick is working just fine.</div><div><br></div><div>Regards<br></div><div>Rana</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Jun 22, 2014 at 1:02 AM, Steve Shipway <span dir="ltr"><<a href="mailto:s.shipway@auckland.ac.nz" target="_blank">s.shipway@auckland.ac.nz</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div style="direction:ltr;font-family:Tahoma;color:#000000;font-size:10pt">There are a couple of issues here.<br>
<br>
Firstly, you are misunderstanding the use of MAX in a DEF. What this means is that you will get the MAX-type RRA, which holds the maximum value over the consolodated interval as a series -- what I think you want is the maximum value over the entire series?
In this case, you need to use a VDEF.<br>
<br>
Secondly, the LINE2 directive will print out the legend line, if you have a description, but without a newline. So, you can easily append to it with a subsequent directive. So, for example:<br>
<br>
"DEF:test:test.rrd:sum:AVERAGE"<br>
"VDEF:testmax:test,MAXIMUM"<br>
"LINE2:test#00FF00:Test Graph, Max value="<br>
"GPRINT:testmax:%6.2lf"<br>
"COMMENT:\\l"<br>
<br>
The COMMENT directive is to force a left-justified newline after printing the legend and the maximum value.<div class=""><br>
<br>
Steve<br>
<div><br>
<div style="font-family:Tahoma;font-size:13px">
<div style="font-family:Tahoma;font-size:13px"><strong>Steve Shipway</strong></div>
<div style="font-family:Tahoma;font-size:13px">University of Auckland ITS</div>
<div style="font-family:Tahoma;font-size:13px"><em>UNIX Systems Design Lead</em></div>
<div style="font-family:Tahoma;font-size:13px"><a href="mailto:s.shipway@auckland.ac.nz" target="_blank">s.shipway@auckland.ac.nz</a></div>
<div style="font-family:Tahoma;font-size:13px">Ph: <a href="tel:%2B64%209%20373%207599%20ext%2086487" value="+6493737599" target="_blank">+64 9 373 7599 ext 86487</a></div>
<div style="font-family:Tahoma;font-size:13px"><em></em> </div>
</div>
</div>
</div><div style="font-family:Times New Roman;color:#000000;font-size:16px">
<hr>
<div style="direction:ltr"><font color="#000000" face="Tahoma"><b>From:</b> Md. Ali Ahsan Rana [<a href="mailto:aliahsanrana@gmail.com" target="_blank">aliahsanrana@gmail.com</a>]<br>
<b>Sent:</b> Sunday, 22 June 2014 12:27 p.m.<br>
<b>To:</b> Steve Shipway; <a href="mailto:linux@thehobsons.co.uk" target="_blank">linux@thehobsons.co.uk</a><br>
<b>Cc:</b> <a href="mailto:rrd-users@lists.oetiker.ch" target="_blank">rrd-users@lists.oetiker.ch</a><br>
<b>Subject:</b> Re: [rrd-users] Assign RRDGraph DEF variables to external variable?<br>
</font><br>
</div><div><div class="h5">
<div></div>
<div>
<div dir="ltr">Thanks Steve and Simon for your reply. I get the idea, thanks. However, my current need is little simpler one. I want the value to be shown as part of the title, such as:
<div><br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
$series = "DEF:'test'='$rrd_dir/test.rrd':'sum':AVERAGE " <br>
</blockquote>
<div> . "DEF:'max'='$rrd_dir/test.rrd':'sum':MAX " </div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
."LINE2:test#00FF00:'Test Graph, Max Value={max} ' "</blockquote>
<div>
<div><br>
</div>
<div>As you can see, I want to print the max value of the same data set as part of title. I guess its achievable without calling rrdgraph twice? Can you please give a clue how? Thanks.</div>
<div><br>
</div>
<div>Regards</div>
<div>Rana</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
</div>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Sat, Jun 21, 2014 at 6:17 PM, Steve Shipway <span dir="ltr">
<<a href="mailto:s.shipway@auckland.ac.nz" target="_blank">s.shipway@auckland.ac.nz</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div style="direction:ltr;font-family:Tahoma;color:#000000;font-size:10pt">If you wish to access the RRDTool data programmatically from PHP, then you have two options.<br>
<br>
If you just want a few set values, you could call rrdtool using the PRINT directive to output text on stdout, and capture that, though you then have to parse the captured text.<br>
<br>
If you want to access the entire data series, then you could call 'rrdtool fetch' or 'rrdtool xport' to obtain the data; also, you could install the PHP RRDtool library, and then access it directly from the PHP code rather than having to fork off a separate
process and catch the output. This might be the most efficient way to achieve what you want.<br>
<br>
Steve<br>
<div><br>
<div style="font-family:Tahoma;font-size:13px">
<div style="font-family:Tahoma;font-size:13px"><strong>Steve Shipway</strong></div>
<div style="font-family:Tahoma;font-size:13px">University of Auckland ITS</div>
<div style="font-family:Tahoma;font-size:13px"><em>UNIX Systems Design Lead</em></div>
<div style="font-family:Tahoma;font-size:13px"><a href="mailto:s.shipway@auckland.ac.nz" target="_blank">s.shipway@auckland.ac.nz</a></div>
<div style="font-family:Tahoma;font-size:13px">Ph: <a href="tel:%2B64%209%20373%207599%20ext%2086487" value="+6493737599" target="_blank">
+64 9 373 7599 ext 86487</a></div>
<div style="font-family:Tahoma;font-size:13px"><em></em> </div>
</div>
</div>
<div style="font-family:Times New Roman;color:#000000;font-size:16px">
<hr>
<div style="direction:ltr"><font color="#000000" face="Tahoma"><b>From:</b> rrd-users-bounces+s.shipway=<a href="mailto:auckland.ac.nz@lists.oetiker.ch" target="_blank">auckland.ac.nz@lists.oetiker.ch</a> [rrd-users-bounces+s.shipway=<a href="mailto:auckland.ac.nz@lists.oetiker.ch" target="_blank">auckland.ac.nz@lists.oetiker.ch</a>]
on behalf of Md. Ali Ahsan Rana [<a href="mailto:aliahsanrana@gmail.com" target="_blank">aliahsanrana@gmail.com</a>]<br>
<b>Sent:</b> Saturday, 21 June 2014 4:28 p.m.<br>
<b>To:</b> <a href="mailto:rrd-users@lists.oetiker.ch" target="_blank">rrd-users@lists.oetiker.ch</a><br>
<b>Subject:</b> [rrd-users] Assign RRDGraph DEF variables to external variable?<br>
</font><br>
</div>
<div>
<div>
<div></div>
<div>
<div dir="ltr">Hello EveryOne,
<div><br>
</div>
<div>I am constructing and executing rrdgraph command from php. A sample is as follows:</div>
<div><br>
</div>
<div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
$series = "DEF:'test'='$rrd_dir/test.rrd':'sum':AVERAGE "<br>
."LINE2:test#00FF00:'Test Graph' "</blockquote>
<div><br>
</div>
<div>Now, I want the rrd variable 'test' to be assigned to an external php variable so that I can use that value for other task. How I can achieve this please?</div>
</div>
<div><br>
</div>
<div>Regards</div>
<div>Rana</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div></div></div>
</div>
</div>
</blockquote></div><br></div>