[rrd-users] Re: Anything better than rrdcgi ? (& positioning labels)

Dmytro O. Redchuk d.redchuk at popnet.kiev.ua
Thu Aug 10 15:13:52 MEST 2000


----- Original Message -----
From: Simon Amor <simon.a at webfusion.co.uk>
To: <rrd-users at list.ee.ethz.ch>
Sent: 10 ñåðïíÿ 2000 ð. 15:51
Subject: [rrd-users] Re: Anything better than rrdcgi ? (& positioning labels)

<...skipped some lines...>

> I have a script called graph.cgi, but I'm not sure if it's what you're trying
to do.
>
> #!/bin/bash
>
> echo "Content-type: image/png"
> echo ""
> /usr/local/rrdtool-1.0.25/bin/rrdtool graph - -s now-28800 -e now \
>   --imgformat PNG --title "Bandwidth usage" \
>   DEF:in=bw2.rrd:in:AVERAGE DEF:out=bw2.rrd:out:AVERAGE \
>   AREA:in#0000BB:"Incoming (from internet)" \
>   LINE2:out#00BB00:"Outgoing (to internet)" \
>   GPRINT:in:LAST:'Current In %.2lf%sbps' \
>   GPRINT:in:MAX:'Peak In %.2lf%sbps' \
>   GPRINT:in:AVERAGE:'Average In %.2lf%sbps' \
>   GPRINT:out:LAST:'Current Out %.2lf%sbps' \
>   GPRINT:out:MAX:'Peak Out %.2lf%sbps' \
>   GPRINT:out:AVERAGE:'Average Out %.2lf%sbps'
>

<...skipped some lines...>

>
> What I'd like is to have legend on its own, print all the In stats on one line
and Out stats on the next line.
>
> [-----------------graph-----------------]
> In legend     Out legend
> Current in    Peak in       Average in
> Current out   Peak out      Average out
>
> Any suggestions on how to do this would be much appreciated.

I would try to put '\l' at the end of label somewhere:

 #!/bin/bash

 echo "Content-type: image/png"
 echo ""
 /usr/local/rrdtool-1.0.25/bin/rrdtool graph - -s now-28800 -e now \
   --imgformat PNG --title "Bandwidth usage" \
   DEF:in=bw2.rrd:in:AVERAGE DEF:out=bw2.rrd:out:AVERAGE \
   AREA:in#0000BB:"Incoming (from internet)" \
 # here :
   LINE2:out#00BB00:"Outgoing (to internet)\l" \
   GPRINT:in:LAST:'Current In %.2lf%sbps' \
   GPRINT:in:MAX:'Peak In %.2lf%sbps' \
 # and here :
   GPRINT:in:AVERAGE:'Average In %.2lf%sbps\l' \
   GPRINT:out:LAST:'Current Out %.2lf%sbps' \
   GPRINT:out:MAX:'Peak Out %.2lf%sbps' \
   GPRINT:out:AVERAGE:'Average Out %.2lf%sbps'

Sorry, I didn't try...
It should work.
I just did like this in my perl script.



--
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://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the rrd-users mailing list