[rrd-users] Re: Bug? : RRDs perl module is very picky about trailing white spaces

Alex van den Bogaerdt alex at ergens.op.het.net
Mon Aug 29 17:54:09 MEST 2005

On Mon, Aug 29, 2005 at 05:32:59PM +0200, Andreas Maus wrote:

> > accepted until "maximum" and complained about every token that followed,
> > including its token separator ":".  You gave it a token separator of ":"
> > and a token of " ".
> Yes. That is the part that confuses me. It think it should care about the
> the first colon in the COMMENT statement because it separates the statement
> from text and don't care about colons after that first one. Or at least
> this was the behavior in rrdtool 1.0.x

If you wanted to display a colon in COMMENT, you didn't need to escape it
in rrdtool 1.0.x but if you wanted to display a colon in GPRINT, you did.
(but you were allowed to escape a colon in COMMENT as well!)

RRDtool 1.2.x does it differently: you must escape a colon if you want
it to be interpreted as text.  No ifs, buts and thens.

Parsing is now done the same for all of rrdtool_graph which not only makes
it more easy for developers but also for users.

- you do not need to know different rules for different lines.  A colon
  introduces a new field, no matter what type of line you look at
- All colons belonging to text should be made invisible to rrdtool (by
  means of prefixing them with "\"), no matter where this happens.
- should there ever need to be an optional parameter to COMMENT (I can't
  think of one right now, but just assume there is such need) then it is
  easy to change the parser without introducing another incompatibility.
  This means you don't have to alter existing scripts should this happen.

> > Your operating system and/or your script parser may eat some escape
> > characters (yours does) in which case you need to escape an escape char.
> Yes. If I escape the collons with \ and escape the escape character it works.
> Escaping all relevant colons (and escaping the escape character) is not to much work ...

Indeed, especially since you don't have different rules for GPRINT and COMMENT.
You can feed your text through the same function that adds escape characters.


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