rrdtool graph: COMMENT and empty lines(lf) - comprehension question

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

rrdtool graph: COMMENT and empty lines(lf) - comprehension question

Daniel Schlifka
Hi,

I have a little comprehension question, i'm still struggling/fighting
with rrdtool graph.
Today i tried to create an empty line within the plotted graphs
legend(to separate two lines of text optically).
Following older ML records and StackOverflow Threads i found some
variants to achieve that.
i.e. "COMMENT:\n" && COMMENT:" " && COMMENT:"\n" && COMMENT:"\s\n"

Unfortunately none of these worked for me. I tried in different
variations without success.

What interestingly did the trick was:
COMMENT:"\t\n"


So here's the question - is the related to how COMMENT handle strings?
Are linebreaks considered as part of the string or does COMMENT fail
because it considers the 0x0a as terminator and therefore not part of
the string(unlike tab) and "believes" there is nothing to print?

Another theory would be this has nothing to do with rrdtool but is
caused by some bash-expansion.

Not sure what i'm after here, but it's a bit frustrating. The
Documentation doesn't answer this(or i'm just to stupid to ask the right
question).
Can somebody enlighten me a bit?

Thanks in advance.

kind regards,

Daniel

_______________________________________________
rrd-users mailing list
[hidden email]
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
Reply | Threaded
Open this post in threaded view
|

Re: rrdtool graph: COMMENT and empty lines(lf) - comprehension question

Simon Hobson
Daniel Schlifka <[hidden email]> wrote:

> I have a little comprehension question, i'm still struggling/fighting with rrdtool graph.
> Today i tried to create an empty line within the plotted graphs legend(to separate two lines of text optically).
> Following older ML records and StackOverflow Threads i found some variants to achieve that.
> i.e. "COMMENT:\n" && COMMENT:" " && COMMENT:"\n" && COMMENT:"\s\n"
>
> Unfortunately none of these worked for me. I tried in different variations without success.
>
> What interestingly did the trick was:
> COMMENT:"\t\n"
>
>
> So here's the question - is the related to how COMMENT handle strings? Are linebreaks considered as part of the string or does COMMENT fail because it considers the 0x0a as terminator and therefore not part of the string(unlike tab) and "believes" there is nothing to print?
>
> Another theory would be this has nothing to do with rrdtool but is caused by some bash-expansion.

The latter sounds a likely issue. Checking a script from the past, I see I've used these lines in BASH scripts :
COMMENT:\"            min      ave      max      last\n\"
COMMENT:\"  Data to ${PrintedTime}\n\

It may be something specific to my scripts, in these cases it was a matter of doing :
echo "<load of RRD stuff>" | /usr/bin/rrdcgi --filter - 2>&1 > /dev/null
where <loads of RRD stuff> could amount to thousands of lines of script generated output !

It's was a long time ago that I wrote those scripts, one thing I do recall was struggling at times to get the right quoting for quote marks.

_______________________________________________
rrd-users mailing list
[hidden email]
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users