[rrd-users] Creating dynamic graphs in HTML
Ruttenberg, Tanya
Tanya.Ruttenberg at ssa.gov
Wed Nov 21 14:11:40 CET 2007
This basically works for me (rrdtool-1.2.12). I structure my arguments
a little differently for readability, but I use "-" for output and it
works. For reference here is my code:
my @args = ("-","--start=$starttime","--imgformat=PNG","--width=750","--
base=1000","--title=$title","--height=180","--alt-y-mrtg","--interlaced"
,"--vert
ical-label=Utilization %" );
my @DEFS = ("DEF:a=$rrdfile:cpmcputotal5min:AVERAGE");
my @DRAW = ("AREA:a#00FFFF:CPU Utilization");
my @GPRINTS = ('GPRINT:a:MIN:Min\: %8.2lf%s','GPRINT:a:AVERAGE:Avg\: %8.
2lf%s','GPRINT:a:MAX:Max\: %8.2lf%s','GPRINT:a:LAST:Last\: %8.2lf%s');
RRDs::graph(@args, @DEFS, @DRAW, @GPRINTS);
--TDR
-----Original Message-----
From: rrd-users-bounces at lists.oetiker.ch
[mailto:rrd-users-bounces at lists.oetiker.ch] On Behalf Of Mike Rykowski
Sent: Tuesday, November 20, 2007 4:08 PM
To: rrd-users at lists.oetiker.ch
Subject: [rrd-users] Creating dynamic graphs in HTML
Hello,
I'm trying to create inline graphs using rrdtool 1.2.23 (RRDs).
I have something like this in a perl script:
print $cgi->header(-type=>'image/png');
RRDs::graph ("-","-s","-1week","-a","PNG","--width","600","--
height","400","DEF:vtot=file.rrd:total:MAX","AREA:vtot#00FFFF:Total","DE
F:vused=file.rrd:active:MAX","AREA:vused#0000FF:Used");
If I substitute "-" with a file name, it produces a file that I can
view, but when I try to do this inline I get an error saying there are
errors in the image.
I used to do this with gif format in 1.0.49 and it worked just fine.
Any ideas?
TIA
--
Mike Rykowski
NU-IT Telecommunications and Network Services
_______________________________________________
rrd-users mailing list
rrd-users at lists.oetiker.ch
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
More information about the rrd-users
mailing list