[rrd-users] CDEF question

AlphaAlien maarten.sundman at plumasbank.com
Tue Dec 9 01:43:45 CET 2008

Solved it, you can't just gprint values off of a cdef you have to print them
to the graph, so I made the total value show as a shaded background with
values written below using VDEF's to grab values from the CDEF.

AlphaAlien wrote:
> So I'm trying to make a totals column from 3 data variables in a graph,
> but for some reason it's giving : ERROR: Cannot parse CF in
> 'GPRINT:total:%lf'
> If I remove the CDEF and the GPRINT for adding the 3 values it works fine.
> I'm kind of new to RPN but I believe I have the syntax proper
> CODE: CDEF:total=p1cur,p2cur,+,p3cur,+
> I also tried variations on this like CDEF:total=p1cur,p2cur,p3cur,+,+
> Full command:
> E:\MRTG\rrdtool\Release\rrdtool.exe graph --title
> " Rack B5" --vertical-label "mA" --y-grid 2:5
> DEF:load1=
> DEF:load2=
> DEF:load3= VDEF:p1max=load1,MAXIMUM
> VDEF:p1avg=load1,AVERAGE VDEF:p1min=load1,MINIMUM VDEF:p1cur=load1,LAST
> VDEF:p2max=load2,MAXIMUM VDEF:p2avg=load2,AVERAGE VDEF:p2min=load2,MINIMUM
> VDEF:p2cur=load2,LAST VDEF:p3max=load3,MAXIMUM VDEF:p3avg=load3,AVERAGE
> VDEF:p3min=load3,MINIMUM VDEF:p3cur=load3,LAST COMMENT:"\\n" COMMENT:"               
> Maximum" COMMENT:"  Average" COMMENT:"Minimum"  COMMENT:"Current\j"
> COMMENT:"\\n" LINE2:load1#FF0000:"Phase 1" GPRINT:p1max:"%3.2lf mA"
> GPRINT:p1avg:"%3.2lf mA" GPRINT:p1min:"%3.2lf mA" GPRINT:p1cur:"%3.2lf
> mA\j" COMMENT:"\\n" LINE2:load2#00FF00:"Phase 2" GPRINT:p2max:"%3.2lf mA"
> GPRINT:p2avg:"%3.2lf mA" GPRINT:p2min:"%3.2lf mA" GPRINT:p2cur:"%3.2lf
> mA\j" COMMENT:"\\n" LINE2:load3#0000FF:"Phase 3" GPRINT:p3max:"%3.2lf mA"
> GPRINT:p3avg:"%3.2lf mA" GPRINT:p3min:"%3.2lf mA" GPRINT:p3cur:"%3.2lf
> mA\j" CDEF:total=p1cur,p2cur,+ COMMENT:"\\n" GPRINT:total:"%lf"
> Thank you for any help in advance, aside from the CDEF this works fine for
> pulling current amperage from APC PDU's on all 3 phases.

View this message in context: http://n2.nabble.com/CDEF-question-tp1631600p1631772.html
Sent from the RRDtool Users Mailinglist mailing list archive at Nabble.com.

More information about the rrd-users mailing list