[rrd-users] Formating legend problem

Alex van den Bogaerdt alex at ergens.op.het.net
Tue Jan 30 12:35:20 CET 2007


On Tue, Jan 30, 2007 at 11:08:15AM +0000, Valentinos Charalambous wrote:

> variables can be:
> a
> ab
> abc
> abcd
> ..
> abcdefghij

do not use "%s", use "%10s" or "%-10s" to print these names.

"a         "
"ab        "
"abc       "
"abcd      "
 ..
"abcdefghij"

This is something you need to do in your front end, not in rrdtool itself.
RRDtool would already see those spaces in its legend:

"LINE1:a#FF0000:a         :STACK"
"LINE1:ab#FF0000:ab        :STACK"
"LINE1:abc#FF0000:abc       :STACK"

Next run:

"LINE1:ab#FF0000:ab        :STACK"
"LINE1:abc#FF0000:abc       :STACK"
"LINE1:a#FF0000:a         :STACK"

In other words, the printf command generating your grapher script could be:

printf(" LINE%i:%s#%s:%-10s:STACK",linewidth,vname,color,vname);


HTH
-- 
Alex van den Bogaerdt
http://www.vandenbogaerdt.nl/rrdtool/



More information about the rrd-users mailing list