[rrd-users] Re: RRDs::graph and mod_perl
Todd Caine
todd_caine at eli.net
Tue Aug 1 18:31:32 MEST 2000
Philip,
I've been working on doing the same thing. I wanted to have a mod_cgi or
mod_perl script generate images based on the arguments passed to it so that
I could use the script in the <IMG SRC=script.cgi?args> tags. I actually
tried it with FastCGI and Apache first with no success. I could run it from
the command line and it would send the output in binary format to stdout.
When I tried to run it under Apache, the output would get sent to my
error_log file. Weird. I then tried a mod_perl script to do that same
thing but this time there was no data at all. I went the open source
conference in Monterey, CA and spoke with Doug MacEachern, the man behind
mod_perl, and he said that I should try to build Perl with the sfio
library. I haven't had the chance to try it yet, but it's worth a shot.
Here is exactly what I was told:
The output of system(), exec(), and open(PIPE, "|program") calls will not be
sent to the browser unless you Perl was configured with sfio. You can use
backticks as a possible workaround, but you're throwing performance out the
window either way.
Hope this helps. Let me know if you try the sfio route. I would greatly
appreciate it.
Ciao,
TOdd
Philip Molter wrote:
> I'm using RRDs with mod_perl on a Solaris 8 box with
> Apache/mod_perl and perl 5.6.0. The call to RRDs::graph is made
> with various arguments to print to a file on STDOUT. RRDs reports
> no error, but no graph information is sent to STDOUT. This process
> works fine without mod_perl. I've attached the part of a truss
> output where the problem appears to be occurring. Any ideas? I
> know I could output to a temporary file, print the contents of the
> temporary file, and then unlink the file (how Bronc does it), but
> that's extremely inefficient.
>
> Any ideas?
>
> Philip
>
> ps. filenames have been changed to protect the innocent
>
> -----TRUSS OUTPUT-----
> # Printing out debug before the graph call begins
> 10909: write(2, " -\n - a P N G\n - h 1".., 1140) = 1140
> 10909: write(2, "\n", 1) = 1
> 10909: time() = 965141926
> 10909: time() = 965141926
> 10909: time() = 965141926
> 10909: open("CPU-cpu.rrd", O_RDONLY) = 6
> 10909: fstat64(6, 0xFFBEE220) = 0
> 10909: ioctl(6, TCGETA, 0xFFBEE1AC) Err#25 ENOTTY
> 10909: read(6, " R R D\0 0 0 0 1\0\0\0\0".., 8192) = 8192
> 10909: llseek(6, 0, SEEK_CUR) = 8192
> 10909: lseek(6, 3569352, SEEK_SET) = 3569352
> 10909: lseek(6, 196296, SEEK_SET) = 196296
> 10909: read(6, " @ %A6AE9A06 0F8 @ 87BB".., 8192) = 8192
> 10909: read(6, " @11BE z v\b E ` @10FC m".., 8192) = 8192
> 10909: llseek(6, 0xFFFFFFFFFFFFE420, SEEK_CUR) = 205544
> 10909: close(6) = 0
> 10909: brk(0x0060B000) = 0
> 10909: brk(0x00625800) = 0
> 10909: ioctl(1, TCGETA, 0xFFBEDFDC) Err#6 ENXIO
> 10909: fstat64(1, 0xFFBEE050) = 0
> 10909: brk(0x00641000) = 0
> 10909: brk(0x0065D800) = 0
> 10909: write(2, " g r a p h : W e p r".., 31) = 31
> 10909: write(2, "\n", 1) = 1
> # Printing out debug after the graph call finishes
>
> * Philip Molter
> * Data Foundry International
> * http://www.datafoundry.net/
> * philip at datafoundry.net
>
> --
> 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
--
--------------------------------------------------------------
<!-- Todd Caine - tcaine at eli.net
Software Engineer
Electric Lightwave, Inc.
4400 NE 77th Avenue
Vancouver, WA 98662
Direct Dial: (360) 816-4344 //-->
--------------------------------------------------------------
--
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