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

Simon Amor simon.a at webfusion.co.uk
Thu Aug 10 14:51:03 MEST 2000


Jerome Fleury <jerome.fleury at none.net> wrote:
> I want my Web pages to be generated dynamically with mod_perl. Problem
> is that the only way to have graphs generated dynamically is to pass
> through rrdcgi, and it gets a bit complicated.
>
> Is there any other smart way to dynamically generate graphs on HTML
> pages ?

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'

It's very basic and should really be replaced with a perl version, but I was in "quick-dirty-hack" mode at the time. I then include
it in an html file:

<IMG SRC="graph.cgi">

It works fine apart from the labels being in strange places. Underneath, I'm trying to position the text labels so that they appear
in a more sensible location. At present:

[-----------------graph-----------------]
In legend     Out legend     Current in
Peak in       Average in     Current out
Peak out      Average out

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.

-- Simon Amor
Systems Administrator
simon.a at webfusion.co.uk



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