I have implemented HWdEtect plugin to NfSen based on Holt-Winters method, using RRD database. But I have an issue to solve.
See the image...
You can see yellow areas which means that the plugin discovered some kind of anomaly behavior. It should be displayed only if the measured (green) area is lower or higher than confidence band (red). But in several cases it is colored by yellow even if it is not out of the bands. I looked into the .rrd file and in RRA FAILURES it is signed as a failure (value 1).
So I think, I have something wrong in displaying confidence bands (red).
In my code I do this:
Code: Select all
RRDs::graph "$BACKEND_PLUGINDIR/hwdetect/plots/hwdetect-$profile-$rrd_var-$channel-00.png",
"--title", "HWdEtect $rrd_var prediction",
"--start", "$start - 86400",
"--end", "$start",
"--lower-limit=0",
"--rigid",
"--width=600",
"--height=200",
"--alt-autoscale-max",
"--imgformat","PNG",
"DEF:obs=$rrds[0]:$rrd_var:AVERAGE",
"DEF:pred=$rrds[0]:$rrd_var:HWPREDICT",
"DEF:dev=$rrds[0]:$rrd_var:DEVPREDICT",
"DEF:fail=$rrds[0]:$rrd_var:FAILURES",
"TICK:fail#ffffa0:1.0:\"Failures\"",
"AREA:obs#00ff00:\"Measured count of $rrd_var\"",
"LINE2:pred#0000ff:\"HW Prediction\"",
"CDEF:upper=pred,dev,$deltapos[0],*,+",
"CDEF:lower=pred,dev,$deltanegs[0],*,-",
"LINE1:upper#ff0000:\"Upper Confidence Bound\"",
"LINE1:lower#ff0000:\"Lower Confidence Bound\""
;
Code: Select all
"CDEF:upper=pred,dev,$deltapos[0],*,+",
"CDEF:lower=pred,dev,$deltanegs[0],*,-",
"LINE1:upper#ff0000:\"Upper Confidence Bound\"",
"LINE1:lower#ff0000:\"Lower Confidence Bound\""
Is it right? Is there a bug in rrdtool or should I use different value of delta in the plot creation?
Thanks in advise. If necessary I could post additional information/code...