<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style>
<!--
.EmailQuote
        {margin-left:1pt;
        padding-left:4pt;
        border-left:#800000 2px solid}
-->
</style><style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">A couple of ideas come to mind. I suspect (2) is the one you'll go for.<br>
<br>
1. Use previous values.<br>
If you do a CDEF in your graphing, like CDEF:newx=x,UN,PREV(x),x,IF then you can graph this, and you'll get the previous value used when it is unknown. This will result in displaying a horizontal line from the last known value. This is the default action
of native-mode MRTG.<br>
<br>
2. Use very big heartbeat values in your RRD.<br>
If you set an extremely large heartbeat, then when you get the first valid data after a long period of nothing, it will interpolate ALL the intervening values (provided the time since the last value is <heartbeat). Note that updating with 'unknown' is not
the same as not updating at all. I've used something like this to give a continuous graph when data come in very irregularly with potentially big gaps. The downsides are that this modifies the data as stored in the RRD, so you have no record of when the
data are interpolated vs 'real'. The benefit is that you just have to tweak the RRD file and that's it; no special coding.<br>
<br>
3. Use Holt-winters RRAs to fill in.<br>
This is the cool solution that requires lots of work. Set up a Holt-Winters RRA set, with a daily period to predict the value of the data. Then, when X is unknown, use the HWPREDICT RRA. As time goes by, you'll get more accurate predictions, as long as
some times you have data for that time window.<br>
CDEF:newx=x,UN,hwx,x,IF<br>
This has the benefit of not altering your real data, and giving a convincing pattern for the infill. The downside is a lot more work, and that the infill accuracy improves with the amount of historical data you collect. You might want to make a smaller period
for the HWPREDICT if you never have data for that time window; this all depends on your data pattern and periodicity. You'd need to tune the HW params over time.<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">s.shipway@auckland.ac.nz</a></div>
<div style="font-family:Tahoma; font-size:13px">Ph: +64 9 373 7599 ext 86487</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 tabindex="-1">
<div style="direction: ltr;" id="divRpF192750"><font color="#000000" face="Tahoma" size="2"><b>From:</b> rrd-users-bounces+s.shipway=auckland.ac.nz@lists.oetiker.ch [rrd-users-bounces+s.shipway=auckland.ac.nz@lists.oetiker.ch] on behalf of Joachim Larsson [joachim.larsson@ericsson.com]<br>
<b>Sent:</b> Thursday, 28 February 2013 2:49 a.m.<br>
<b>To:</b> rrd-users@lists.oetiker.ch<br>
<b>Subject:</b> [rrd-users] rrd graph inter/extrapolation of large U / NaN blocks<br>
</font><br>
</div>
<div></div>
<div><font face="Arial" size="2"><span style="font-size:10pt">
<div>Hello,<br>
<br>
Im web-scraping a stock-market page which is only open daytime, thus my rrd-database will have huge gaps in the data. I've been trying to make a CDEF that uses old values and tries to inter/extrapolate the gaps, but to no avail.<br>
<br>
Can anyone shed some light regarding converting U to a straight line between the previous and last successful rrd data?<br>
<br>
I create the rrd with the following;<br>
rrdtool create stocklol.rrd --start $starttime -s 300\<br>
DS:latest:GAUGE:600:0:U \<br>
DS:volume:COUNTER:600:0:U \<br>
RRA:AVERAGE:0.5:1:8640 \<br>
RRA:AVERAGE:0.5:4:52560<br>
<br>
The data is being updated 0800 -> 1800 CET, all other values are NAN / U </div>
<div> </div>
<div>Google and other sources doesnt hint on this, as far as i could tell. Alot of refrences to making unknown into 0, but that's absolutely not what i want. I checked the CDEF and RPN docs refrenced in rrdgraph pages.</div>
<div> </div>
<div>Sincerely,</div>
<div>Joachim</div>
<div> </div>
<div> </div>
<div> </div>
</span></font></div>
</div>
</div>
</body>
</html>