Guys, i am trying to get the value of the previous data read with a "PREV" CDEF function, but it is not working. Is it a known bug? Any suggestion? I cannot get any graphic with this function.
RRDTool Command:
/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title='Flexi NG - PDP Stats - apn Internet2' \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit='0' \
--vertical-label='PDP Contexts2' \
--slope-mode \
--font TITLE:10: \
--font AXIS:7: \
--font LEGEND:8: \
--font UNIT:7: \
DEF:a='/var/www/html/cacti/rra/flexi_ng_pdpfailinter2_2867.rrd':'pdpfailInter2':AVERAGE \
CDEF:cdefa='PREV,a' \
LINE1:cdefa#FF5576FF:'PDP' \
GPRINTLAST:'Current\:%8.0lf' \
GPRINTAVERAGE:'Average\:%8.0lf' \
GPRINTMAX:'Max\:%8.0lf'
RRDTool Says:
ERROR: RPN final stack size != 1
PREV Function CDEF not working...
Moderators: Developers, Moderators
Re: PREV Function CDEF not working...
I also used a different structure for the PREV function, but still not working:
RRDTool Command:
/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title='Flexi NG - PDP Stats - apn Internet2' \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit='0' \
--vertical-label='PDP Contexts2' \
--slope-mode \
--font TITLE:10: \
--font AXIS:7: \
--font LEGEND:8: \
--font UNIT:7: \
DEF:a='/var/www/html/cacti/rra/flexi_ng_pdpfailinter2_2867.rrd':'pdpfailInter2':AVERAGE \
CDEF:cdefa='a,PREV' \
LINE1:cdefa#FF5576FF:'PDP' \
GPRINTLAST:'Current\:%8.0lf' \
GPRINTAVERAGE:'Average\:%8.0lf' \
GPRINTMAX:'Max\:%8.0lf'
RRDTool Says:
ERROR: RPN final stack size != 1
RRDTool Command:
/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title='Flexi NG - PDP Stats - apn Internet2' \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit='0' \
--vertical-label='PDP Contexts2' \
--slope-mode \
--font TITLE:10: \
--font AXIS:7: \
--font LEGEND:8: \
--font UNIT:7: \
DEF:a='/var/www/html/cacti/rra/flexi_ng_pdpfailinter2_2867.rrd':'pdpfailInter2':AVERAGE \
CDEF:cdefa='a,PREV' \
LINE1:cdefa#FF5576FF:'PDP' \
GPRINTLAST:'Current\:%8.0lf' \
GPRINTAVERAGE:'Average\:%8.0lf' \
GPRINTMAX:'Max\:%8.0lf'
RRDTool Says:
ERROR: RPN final stack size != 1
Re: PREV Function CDEF not working...
does anybody else have this issue? somebody solved it? Thanks in advance for your help...
Re: PREV Function CDEF not working...
The error itself is telling you that your CDEF is formatted wrong. You basically have 2 parameters in it, but no operator.
Re: PREV Function CDEF not working...
Well, i also added operators (-), specifically I created this formula: "(Current Data) - PREV(Current Data)"
and still the same problem. Any example or suggestions?
I just need to get the delta (difference) between the actual data value and previous data value.
Thanks in advance
and still the same problem. Any example or suggestions?
I just need to get the delta (difference) between the actual data value and previous data value.
Thanks in advance
Re: PREV Function CDEF not working...
well not sure if this will be of any help to You
here is an example from rrdtool page
MEDIAN FILTER: filters shot noise
And here some snippets from old thread in rrdtoll discussion group
You always need some "if (unknown) then this else that" logic in your
CDEFs when using prev or prev().
(n.b. the following examples will probably not work because they
don't use another CDEF or a DEF)
"CDEF:x=PREV,UN,0,PREV,1,+,IF" would look at the previous value. If this
is unknown, result is 0, else result is one more than the previous value.
Result for n intervals: 0,1,2,3,4,5,6,7,8,9,....,n-1
"CDEF:x=PREV,UN,0,UNKN,IF" would alternate between zero and unknown.
--edit--
I also found this bug report regarding prev in cacti 0.8.6f (its fixed) but it contais some usage examples
http://bugs.cacti.net/view.php?id=612
here is an example from rrdtool page
MEDIAN FILTER: filters shot noise
Code: Select all
DEF:var=database.rrd:traffic:AVERAGE
CDEF:prev1=PREV(var)
CDEF:prev2=PREV(prev1)
CDEF:prev3=PREV(prev2)
CDEF:median=prev1,prev2,prev3,+,+,3,/
LINE3:median#000077:filtered
LINE1:prev2#007700:'raw data'
You always need some "if (unknown) then this else that" logic in your
CDEFs when using prev or prev().
(n.b. the following examples will probably not work because they
don't use another CDEF or a DEF)
"CDEF:x=PREV,UN,0,PREV,1,+,IF" would look at the previous value. If this
is unknown, result is 0, else result is one more than the previous value.
Result for n intervals: 0,1,2,3,4,5,6,7,8,9,....,n-1
"CDEF:x=PREV,UN,0,UNKN,IF" would alternate between zero and unknown.
--edit--
I also found this bug report regarding prev in cacti 0.8.6f (its fixed) but it contais some usage examples
http://bugs.cacti.net/view.php?id=612
Who is online
Users browsing this forum: No registered users and 0 guests