[rrd-users] Re: Perl script doesn't create graph on link click

Allan Houston ahouston at blueyonder.co.uk
Mon May 5 22:03:11 MEST 2003


Hi Ketan,

----- Original Message -----
From: "Ketan Patel" <k2pattu at yahoo.com>
To: <rrd-users at list.ee.ethz.ch>
Sent: Monday, May 05, 2003 2:05 AM
Subject: [rrd-users] Perl script doesn't create graph on link click


> Hello, After successfully creating graphs with help of rrduser's mailing
list, I have two perl-graph related issues (hopefully this should be last :)
My perl script (in cgi-bin) has commands to create two graphs using rrd perl
module. This script also create statistics. Script has a link on main page
and when link is clicked, it should create/load graphs and statistics
dynamically into browser.  When executed from command line, my script create
two graphs (along with descriptive text stastitics). Directing output of
command line execution into a html file, and viewing that html page
separately in browser shows both the graphs and stats in browser. So far so
good. However, when same script is accessed/executed using link on main
page -first: it doesn't create graphs (it creates text statistics though).
"ls -l" verifies it.second: output created on link click shows statistics
only and not the graphs even though they already exist (created by previous
command line execution). "View Source" shows it has proper <img> tag with
correct image information.  Do I need to "catch" output of RRDs::graph
function in order to create it/refer it? Or do I need to make any changes
into perl script to make it work? Perl/RRDtool gurus out there, I really
need this issue resolved. Please share your expertise on this. Not to
increase length of this mail, I haven't pasted code here. If you want me to
post the code as well, please let me know. Thanksk2

>>

I'm guessing that this might be a file  / directory permissions problem ?
You might want to check that you haven't statically created your gif files
as another user perhaps ? For example, when you statically create the images
from your command line, the resulting images should be owned by the user
executing the script. However, when your cgi runs , the user creating the
images - say the apache user for example - might not have permission to
write to the html directory, or more likely to overwrite the files you
created earlier ?

It might be worthwhile adding something like this to your cgi :

my $err=RRDs::error;
if ($err) { print "Problem graphing foo.gif : $err\n"; }

So that you can see if this is where the problem lies ?

Cheers,
Allan Houston


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