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

Ketan Patel k2pattu at yahoo.com
Mon May 5 23:36:12 MEST 2003


Thanks Allan. Earlier in the day, Deej pointed out the same suggestion that you mentioned.  Indeed, it was a permission issue, script when ran as apache user, didnt create image in html directory. Tweaking of permissions fixed it.  My another issue was, even after creating graph, it wasnt showing it in browser. Deej suggested to check error-log, and from there I figured out error in path mentioned in print statements in perl scripts. I'd mentioned absolute path to image, whereas according to error-log script was looking for relative path starting from web-root directory. Changing the path fixed that error too. So, now I am good to go. Thanks for your feedback any how,cheersKetan
Allan Houston <ahouston at blueyonder.co.uk> wrote:Hi Ketan,

----- Original Message -----
From: "Ketan Patel" 
To: 
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  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


\\\ ///
    / ó ó \
   0   |   0
    \  U  /
-ooo--oooo-
cheers 	 
It's wonderful when I live in present

---------------------------------
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.

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