[rrd-users] CDEF invalid rpn expression 2 - The metoo thread

Luca Corti luca at leenoox.net
Sat Dec 30 03:26:21 MET 2006


Hello,

I've found this thread in the list archives.

http://lists.ee.ethz.ch/rrd-users/msg12158.html

I've just subscribed so I can't reply to the original poster, but I
think I'm hitting the same issue (bug?). I'm running php_rrdtool from
contrib/ under lighttpd 1.4.13, php 5.2.0, rrdtool 1.2.15.

This is my graph command:

    $opts = array(
      "--lazy",
      "--start=-1".$time,
      "--title=PVC ".$vpi."/".$vci,
      "--base=1024",
      "--vertical-label=traffic/s",
      "--slope-mode",
      "DEF:InBytes=".$rrd.":InOctets:AVERAGE",
      "DEF:OutBytes=".$rrd.":OutOctets:AVERAGE",
      "VDEF:FirstDate=InBytes,FIRST",
      "VDEF:LastDate=InBytes,LAST",
      "AREA:InBytes#00FF00:In Bytes",
      "LINE1:OutBytes#0000FF:Out Bytes",
      "COMMENT:\\s",
      "COMMENT:\\s",
      "COMMENT:\\s",
      "GPRINT:FirstDate:Dal %d/%m/%Y %T\\g:strftime",
      "GPRINT:LastDate: al %d/%m/%Y %T\\c:strftime"
    );

    $ret = rrd_graph($graph, $opts, count($opts));

should be quite straightforward how this translates to an rrdtool
commandline call. Everyting works like a charm, but if I want to add two
CDEFs to calculate bits instead of bytes like this:

      "--lazy",
      "--start=-1".$time,
      "--title=PVC ".$vpi."/".$vci,
      "--base=1024",
      "--vertical-label=traffic/s",
      "--slope-mode",
      "DEF:InBytes=".$rrd.":InOctets:AVERAGE",
      "DEF:OutBytes=".$rrd.":OutOctets:AVERAGE",
      "DEBUGCDEF:InBits=InBytes,8,*",
      "DEBUGCDEF:OutBits=OutBytes,8,*",
      "VDEF:FirstDate=InBytes,FIRST",
      "VDEF:LastDate=InBytes,LAST",
      "AREA:InBytes#00FF00:In Bytes",
      "AREA:InBits#00F000:In Bits",
      "LINE1:OutBytes#0000FF:Out Bytes",
      "LINE1:OutBits#0000F0:Out Bits",
      "COMMENT:\\s",
      "COMMENT:\\s",
      "COMMENT:\\s",
      "GPRINT:FirstDate:Dal %d/%m/%Y %T\\g:strftime",
      "GPRINT:LastDate: al %d/%m/%Y %T\\c:strftime"

I get this error:

rrd_graph() ERROR: invalid rpn expression in: InBytes,8,*

I verified my syntax and evaluated advice given to OP, but everything
seems correct. Also tried DEBUGCDEF as suggested and got this:

Scanning line 'CDEF:InBits=InBytes,8,*'
- found function name 'CDEF'
- parsing 'InBits=InBytes,8,*'
- found candidate 'InBits'
- created vname 'InBits' vidx 2

I think 'vidx 2' is the key here but no clue what that means and found
no mention in the docs about DEBUGCDEF.

thanks

Luca

--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://lists.ee.ethz.ch/rrd-users
WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi



More information about the rrd-users mailing list