[rrd-users] RRD Graphs on the fly?

Alexander Krogloth alex at muh.cc
Tue May 15 09:50:33 CEST 2007


Hey,

> 2) Create on-the-fly graphs from this data for the user
on-the-fly graphs are possible with cgi, i've got an example with bash,
you could translate that to perl and it should work ...
(excuse my english):

---------------
#!/bin/sh

. /data/rrd/etc/graph.conf

RRD="$RRDDIR/hddtemp.rrd"

echo "Content-Type: image/png";
echo "";

# time
starttime $1

# graph
$RRDTOOL graph - \
   -t "HDD Temperatures" -v "° Celsius" \
   --start="$TIME" \
   --end="now" \
   --height="$HEIGHT" \
   --width="$WIDTH" \
   -c "$BACK" \
   -c "$SHADEA" \
   -c "$SHADEB" \
   -c "$FONT" \
   -c "$CANVAS" \
   -c "$GRID" \
   -c "$MGRID" \
   -c "$FRAME" \
   -c "$ARROW" \
   "DEF:a=$RRD:disk0:AVERAGE" \
   "DEF:b=$RRD:disk1:AVERAGE" \
   "LINE1:a#dd0000:disk0" \
   "GPRINT:a:LAST:Last\: %5.0lf °C" \
   "GPRINT:a:MIN:Min\: %5.0lf °C" \
   "GPRINT:a:MAX:Max\: %5.0lf °C" \
   "GPRINT:a:AVERAGE:Avg\: %5.0lf °C\l" \
   "LINE1:b#DC143C:disk1" \
   "GPRINT:b:LAST:Last\: %5.0lf °C" \
   "GPRINT:b:MIN:Min\: %5.0lf °C" \
   "GPRINT:b:MAX:Max\: %5.0lf °C" \
   "GPRINT:b:AVERAGE:Avg\: %5.0lf °C\l"
----------

i hope i helped you - otherwise send me an email or join #rrdtool on
IRCnet (krogloth.de/rrd/channel for help)

greets
--aleex

-- 
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
x Alexander Krogloth / alex at muh.cc / http://www.krogloth.de  x
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.oetiker.ch/pipermail/rrd-users/attachments/20070515/52d6e26a/attachment.pgp 


More information about the rrd-users mailing list