can't generate graphs, also getting apache errors...

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
nstephens
Posts: 10
Joined: Sun Dec 07, 2003 11:19 pm
Contact:

can't generate graphs, also getting apache errors...

Post by nstephens »

Hi there, I am really new to rrdtool/cacti (but really excited!) and I have encountered a few errors that are confusing me. I managed to get the install up and running with php/mysql, but i am having some issues getting graphs to generate.

my cron job of cmd.php runs fine, and populates data into my rra/*.rrd file, however the system doesn't create graphs for them.

I have turned Graph debug on, and I get the following error message:

Code: Select all

Warning:  fopen(/usr/local/web/cacti/log/rrd.log): failed to open stream: Permission denied in /usr/local/web/cacti/lib/functions.php on line 274

Warning:  fclose(): supplied argument is not a valid stream resource in /usr/local/web/cacti/lib/functions.php on line 276
OK
I have checked the following permissions to be true:

apache is run as user 'nobody'
/usr/local/web/cacti/ is owned by 'nobody:nobody'
/usr/local/web/cacti/rra/ and log/ are owned by user/group 'cacti:cacti'
all /usr/local/web/cacti/ files are 755
the cacti user can read/write to the /usr/local/web/cacti/rra/ files and logs

This all seems proper to me, but i get broken links for my images, and it complains that it cannot open the rrd.log

another issue I see is that when I try to view the Graphs page in preview mode, it generates the following error in my apache error_log

Code: Select all

ERROR: rpn expressions without variables are not supported
any help would be greatly appreciated.
Nick
User avatar
bulek
Cacti Pro User
Posts: 854
Joined: Mon May 20, 2002 2:07 am
Location: Poland
Contact:

Post by bulek »

As you said apache is run as "nobody" user. This means it can't write to a log file (which is writeable for "cacti") while you try to open graphs page. This probably does not solve all your problems but at least one off.

- Piotr
Guest

Post by Guest »

I am also seeing this same error...

Warning: fopen(/export/home/twebb/cacti-0.8.4/log/rrd.log) [function.fopen]: failed to create stream: Permission denied in /export/home/twebb/cacti-0.8.4/lib/functions.php on line 274

Warning: fclose(): supplied argument is not a valid stream resource in /export/home/twebb/cacti-0.8.4/lib/functions.php on line 276
OK
nstephens
Posts: 10
Joined: Sun Dec 07, 2003 11:19 pm
Contact:

Post by nstephens »

oh, very good!

I went into my cacti webroot directory, and did the following, which is at least allowing the graphs to be created now:

chmod -R 775 rra/ log/
chown -R cacti:nobody rra/ log/

now both users can play happily with the log, and thus pictures are being generated.

I will take a look at my other issues and post on them as they arise.

Thank you!
nstephens
Posts: 10
Joined: Sun Dec 07, 2003 11:19 pm
Contact:

Post by nstephens »

It would seem I spoke a little too quickly. While it is true that the images are now present (no broken links!), there is no data being displayed ON the graphs.

per the FAQ, I checked the permissions on the rra/ directory, and got the following:

Code: Select all

[cacti@paladin cacti] ls -al rra/
total 504
drwxrwxr-x    2 cacti    nobody       4096 Dec  8 10:43 .
drwxr-xr-x   12 cacti    cacti        4096 Dec  7 18:35 ..
-rw-r--r--    1 cacti    cacti       47836 Dec  8 09:13 paladin_load_avg_31.rrd
-rw-r--r--    1 cacti    cacti       47836 Dec  8 10:41 paladin_mem_buffers_36.rrd
-rw-r--r--    1 cacti    cacti       94660 Dec  8 10:36 paladin_traffic_in_32.rrd
-rw-r--r--    1 cacti    cacti       94660 Dec  8 10:43 paladin_traffic_in_33.rrd
-rw-r--r--    1 cacti    cacti       94660 Dec  8 10:43 paladin_traffic_in_34.rrd
-rw-r--r--    1 cacti    cacti       94660 Dec  8 10:43 paladin_traffic_in_35.rrd
-rwxrwxr-x    1 cacti    nobody          0 Nov 16 20:21 .placeholder
an interesting point here as well, is that my crontab is setup to run every 5 minutes (i verified that it is running per my /var/log/cron), however it doesn't seem to actually UPDATE those .rrd's until I run the cmd.php by hand...

for fun, here is my crontab entry for the cacti user:

Code: Select all

0,5,10,15,20,25,30,35,40,45,50,55 * * * * php /usr/local/web/cacti/cmd.php > /dev/null 2>&1
but, even when I run cmd.php manually, and verify that the .rrd's updated, i still get no data on my graphs.

Help me oh genuises of the internet :)
nstephens
Posts: 10
Joined: Sun Dec 07, 2003 11:19 pm
Contact:

Post by nstephens »

On a whim, I added the full path to php into my cron entry to make it:

Code: Select all

0,5,10,15,20,25,30,35,40,45,50,55 * * * * /usr/local/bin/php /usr/local/web/cacti/cmd.php > /dev/null 2>&1
and now it is updating my .rrd files properly. oddly, php is in my path when i log in as the cacti user, but i guess it's failing in the cron.

Seems to work now though!
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests