poller.php - permission denied

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
cal
Posts: 3
Joined: Thu Nov 08, 2007 8:26 am

poller.php - permission denied

Post by cal »

Hi Guys,

First post here. Great forum btw!

ok... i've been trying unsuccessfully to get this beast up and running. My main issue is that i cant get the poller program to run.

e.g.

Code: Select all

cactiuser@linux:/usr/local/apache2/htdocs/cacti> php -q poller.php

Warning: main(./include/config.php): failed to open stream: Permission denied in poller.php on line 37
there's quite a few lines of these errors.

I've tried running poller.php or cmd.php as root, and it runs but doesnt give any status info after running (e.g. how many devices were polled etc), and doesnt store any info in the rra or log folders. e.g.:

Code: Select all

linux:/usr/local/apache2/htdocs/cacti # php cmd.php
linux:/usr/local/apache2/htdocs/cacti # php poller.php
linux:/usr/local/apache2/htdocs/cacti # ls

After each time i run poller or cmd with root i always chown the rra and log files back to cactiuser.

The crontab file doesnt seem to be working either - i've redirected any output to a log file and there's nothing in the logfile.

When i log in to the cacti web interface, under the graph debug info i get:

Code: Select all

ERROR: opening '/usr/local/apache2/htdocs/cacti/rra/calvins_computer_traffic_in_8.rrd': No such file or directory
For setup i've used these two resources:

http://www.cacti.net/downloads/docs/con ... how-to.pdf
and
http://docs.cacti.net/node/5
and
http://www.cacti.net/downloads/docs/html/

I would very very much appreciate any help

Cal
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

It may have happend, that you're facing more than one error, now.
First, let's sort out the rrd file ownership. From your "root" sessions, I suppose the rrd files created then are owner by root. So no access for your webserver's userid nor from cactiuser. Please run

Code: Select all

chown -R cactiuser:cactiuser log/ rra/
from the cacti main directory as root.
Then, please run the poller.php as cactiuser only to prevent this accident to happen again. Please verify, that poller.php is at least readable for cactiuser.
Reinhard
cal
Posts: 3
Joined: Thu Nov 08, 2007 8:26 am

Post by cal »

Hi Gandalf,

thanks heaps for your response.

I ran the chown command you gave, but that hasnt made any difference.

So i used chmod on the whole cacti folder to give the cactiuser full read/write/execute permissions on everything, but that hasnt worked either.

the errors im getting are:
cactiuser@linux:/usr/local/apache2/htdocs/cacti> php poller.php

Warning: main(./include/config.php): failed to open stream: Permission denied in
poller.php on line 37

Warning: main(): Failed opening './include/config.php' for inclusion (include_pa
th='.:/usr/local/apache2/htdocs/cacti:/usr/share/php:/php/includes') in poller.p
hp on line 37
So it looks like i've still definitely got permissions problems running:
/usr/local/apache2/htdocs/cacti/indclude/config.php

now when i run the config .php file from within the cacti directory it works fine:
cactiuser@linux:/usr/local/apache2/htdocs/cacti/include> ./config.php
./config.php: line 1: ?php: No such file or directory
./config.php: line 2: /bin: is a directory
./config.php: line 3: +-------------------------------------------------------------------------+: command not found
./config.php: line 4: syntax error near unexpected token `|'
./config.php: line 4: ` | Copyright (C) 2004 Ian Berry
But when i run it from the full path as per below, it doesnt work due to permissions errors:
cactiuser@linux:/usr/local/apache2/htdocs/cacti> /usr/local/apache2/htdocs/cacti/include/config.php
bash: /usr/local/apache2/htdocs/cacti/include/config.php: Permission denied
so i think there's something really fundamental that im missing - would really appreciate it if you knew what it was cheers!
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

SELinux in place or stuff?
Reinhard
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest