[rrd-users] How do I get MHWPREDICT to work ?

James Yu cyu021 at gmail.com
Wed May 11 00:53:19 CEST 2011


Hi all,

I am trying to get MHWPREDICT for a data series, and I always get nan when I
do "rrdtool fetch".
I create rrd file with the following command:
rrdtool create temperature.rrd --step 5 \
DS:temp:GAUGE:10:U:U \
RRA:LAST:0.5:1:864000 \
RRA:MIN:0.5:12:72000 \
RRA:MAX:0.5:12:72000 \
RRA:AVERAGE:0.5:12:72000 \
RRA:MHWPREDICT:864000:0.5:0.5:1800

I update the rrd file with the following script (it's been running for more
then 24 hours):
<?php
$degree = 0;
$sinVal = 0;
while(1) {
        $sinVal = sin(deg2rad($degree%360)) * 10 + rand(-10,10);
        $cmd = "rrdtool update temperature.rrd --template temp N:{$sinVal}";
        system($cmd);
        $degree += 0.05;
        sleep(5);
}

I create a png from rrd file with the following command:
rrdtool graph temperature.png \
--end +2h \
--width 800 \
--height 300 \
--slope-mode \
DEF:tAvg=temperature.rrd:temp:AVERAGE \
DEF:tLast=temperature.rrd:temp:LAST \
DEF:tMin=temperature.rrd:temp:MIN \
DEF:tMax=temperature.rrd:temp:MAX \
DEF:tMHW=temperature.rrd:temp:MHWPREDICT \
DEF:tF=temperature.rrd:temp:FAILURES \
CDEF:tP=3600,-1,1800,tLast,PREDICT \
LINE2:tLast#FF770077:LAST \
LINE2:tAvg#55551177:AVG \
LINE2:tMin#0077FF77:MIN \
LINE2:tMax#FF000077:MAX \
LINE2:tMHW#00BB0077:MHW \
LINE2:tF#7700FF77:FAIL \
LINE2:tP#00000077:PREDICT

I can't see any MHWPREDICT data in the graph, so I do fetch to the rrd file
with this command:
rrdtool fetch temperature.rrd MHWPREDICT --start -1h

and I got
...
...
1305067750: nan
1305067755: nan
1305067760: nan
1305067765: nan
1305067770: nan

I am not sure if I made any mistake, please correct me if I did.
Thanks in advance :-)


This is a UTF-8 formatted mail
-----------------------------------------------
James C.-C.Yu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/rrd-users/attachments/20110511/7febc3a7/attachment.htm 


More information about the rrd-users mailing list