[rrd-users] Re: Trying to format legend using GPRINT

Simon Hobson linux at thehobsons.co.uk
Mon Jul 17 17:11:17 MEST 2006


Nataniel Klug wrote:

>    I am starting to use RRD and I am getting a serius difficult in
>making my legend goes pretty in screen...
>
>    I wanna that my GPRINT legend goes into the same colum so I make this
>script (I am using rrdcgi):
>
>                <RRD::GRAPH backbone_trafego_diario.png
>                        --title="consumo de banda backbone (diario)"
>                        --vertical-label="bps"
>                        --width=600
>                        --height=200
>                        --units-exponent=3
>                        --font DEFAULT:8:
>
>                       
>DEF:backbone_in=/etc/mrtg/rrd/trafego/ema/ema.wpci0.rrd:ds0:AVERAGE
>                        "CDEF:backbone_in_bps=backbone_in,8,*"
>                        AREA:backbone_in_bps#54EC48:"download"
>                        LINE1:backbone_in_bps#24BC14:
>                        'GPRINT:backbone_in_bps:MAX:max\:   %4.2lf%sbps'
>                        'GPRINT:backbone_in_bps:AVERAGE:med\: %4.2lf%sbps'
>                        'GPRINT:backbone_in_bps:LAST:atu\:  %4.2lf%sbps\n'
>                       
>DEF:backbone_out=/etc/mrtg/rrd/trafego/ema/ema.wpci0.rrd:ds1:AVERAGE
>                        "CDEF:backbone_out_bps=backbone_out,8,*"
>                        LINE1:backbone_out_bps#1598C3:"upload  "
>                        'GPRINT:backbone_out_bps:MAX:max\: %4.2lf%sbps'
>                        'GPRINT:backbone_out_bps:AVERAGE:med\: %4.2lf%sbps'
>                        'GPRINT:backbone_out_bps:LAST:atu\:  %4.2lf%sbps'
>                >
>
>    For now this is working fine BUT I have a legend that is Mega and all
>others are kilo... When this "Mega" legend comes to kilo the legend will
>be all wrong formating. You can see the graph in this adress:
>
>http://mrtg.cnett.com.br/server/ema/trafego/

I see that everything is lined up in your daily (diario) graph, and 
your code looks OK. I have graphs using :

   COMMENT:"In  "
   AREA:globinave#3F3FFF:"ave"
   GPRINT:vglobinavg:"%6.2lf %sBps"
   LINE1:globinmax#0000BF:"max"
   GPRINT:vglobinmax:"%6.2lf %sBps\n"

   COMMENT:"Out "
   AREA:globoutave#FF3FFF:"ave"
   GPRINT:vgloboutavg:"%6.2lf %sBps"
   LINE1:globoutmax#FF00BF:"max"
   GPRINT:vgloboutmax:"%6.2lf %sBps"  

where the columns line up.

>    If anyone can tell me where to find info about how-to format legends
>so they stay cool I would love to read...

Try http://oss.oetiker.ch/rrdtool/doc/rrdgraph_graph.en.html

Simon

--
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