[rrd-users] Re: Outputting a PNG directly from Perl + RRDs.pm

Chris Josephes cjoseph at mr.net
Fri Jan 14 15:58:01 MET 2000


On Thu, 13 Jan 2000, Chris Snell wrote:

> Hi,
> 
> I'm having trouble getting a perl program (using the RRDs module) to output 
> a PNG directly.   What I would like to be able to do is create a CGI script 
> (running under mod_perl) that will spit out "Content-type: image/png" 
> followed by a graph.  I'm going to eventually call it like this within HTML:
> 
> 	<IMG SRC="/mp-bin/graphgen?host=utah.citysearch.com">
> 
> and it would spit out a graph for the "host".
> 
> The problem is, I can't seem to make the perl module spit out an image 
> directly.  It seems to want to write it to a file instead.  I tried using 
> "-" as a filename but it didn't spit out anything.  Any ideas?

If disk space isn't a problem, why not write to a file, and then send the
file to STDOUT like 14all.cgi does?  Then you could throw in the "--lazy"
option, which would prevent the re-building of the PNG file if the data in
the .rrd hasn't changed.  It would increase the amount of file space used
on disk, but it would result in faster CGI output, since RRD isn't always
creating a graph every time.

It probably depends on how often your data updates, and how often the
resulting graph is accessed.

--                      _______________
 Chris Josephes      __/ MRNet/Onvoy   \
 chrisj at mr.net    __/   www.onvoy.com  /
\________________/



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



More information about the rrd-users mailing list