Problem with poller.php
Moderators: Developers, Moderators
Problem with poller.php
Hi, i've a problem when i run php poller.php from cacti user
-sh-2.05b$ php poller.php
sh: line 1: /php: No such file or directory
sh: line 1: /rrdtool: No such file or directory
help me please.
-sh-2.05b$ php poller.php
sh: line 1: /php: No such file or directory
sh: line 1: /rrdtool: No such file or directory
help me please.
- rony
- Developer/Forum Admin
- Posts: 6022
- Joined: Mon Nov 17, 2003 6:35 pm
- Location: Michigan, USA
- Contact:
Confirm that the Settings for the paths to these executables are correctly set in the Cacti settings.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
- rony
- Developer/Forum Admin
- Posts: 6022
- Joined: Mon Nov 17, 2003 6:35 pm
- Location: Michigan, USA
- Contact:
Run the which as the Cacti user.
Does the Cacti user have the abbility execute those files?
Does the Cacti user have the abbility execute those files?
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
rony wrote:Run the which as the Cacti user.
Does the Cacti user have the abbility execute those files?
[root@]# su - cacti
-sh-2.05b$ which php
/usr/bin/php
-sh-2.05b$ which rrdtool
/usr/bin/rrdtool
-sh-2.05b$ php test
Status: 404
X-Powered-By: PHP/4.4.2
Content-type: text/html
No input file specified.
-sh-2.05b$ rrdtool test
RRDtool 1.0.50 Copyright 1997-2004 by Tobias Oetiker <tobi@oetiker.ch>
Usage: rrdtool [options] command command_options
Valid commands: create, update, graph, dump, restore,
last, first, info, fetch, tune, resize, xport
RRDtool is distributed under the Terms of the GNU General
Public License Version 2. (www.gnu.org/copyleft/gpl.html)
For more information read the RRD manpages
Hi, i'm debuging poller.php.
The error is on line 133:
exec_background($command_string, "$extra_args $first_host $last_host");
The command generated is:
/usr/bin/php -q /var/www/cacti/cmd.php 0 1
If i run this command from cacti user i get this error:
-sh-2.05b$ /usr/bin/php -q /var/www/cacti/cmd.php 0 1
->refusedsh: line 1: /perl: No such file or directory
sh: line 1: /perl: No such file or directory
sh: line 1: /perl: No such file or directory
sh: line 1: /perl: No such file or directory
sh: line 1: /perl: No such file or directory
But:
-sh-2.05b$ which perl
/usr/bin/perl
Can you help me?
The error is on line 133:
exec_background($command_string, "$extra_args $first_host $last_host");
The command generated is:
/usr/bin/php -q /var/www/cacti/cmd.php 0 1
If i run this command from cacti user i get this error:
-sh-2.05b$ /usr/bin/php -q /var/www/cacti/cmd.php 0 1
->refusedsh: line 1: /perl: No such file or directory
sh: line 1: /perl: No such file or directory
sh: line 1: /perl: No such file or directory
sh: line 1: /perl: No such file or directory
sh: line 1: /perl: No such file or directory
But:
-sh-2.05b$ which perl
/usr/bin/perl
Can you help me?
- rony
- Developer/Forum Admin
- Posts: 6022
- Joined: Mon Nov 17, 2003 6:35 pm
- Location: Michigan, USA
- Contact:
What shell is cactiuser using?
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
Hi,
I've got the same problem.
- I just installed cacti with apt-get install cacti
- I use Ubuntu 6.06
- Everything works fine except the poller (Webinterface etc. are fine)
Sascha
I've got the same problem.
- I just installed cacti with apt-get install cacti
- I use Ubuntu 6.06
- Everything works fine except the poller (Webinterface etc. are fine)
The crontab exists within /etc/cron.d/usr/bin/php /usr/share/cacti/site/poller.php
sh: /php: No such file or directory
sh: /rrdtool: No such file or directory
Someone has a hint for me what kind of problem it is?cat /etc/cron.d/cacti
MAILTO=root
*/5 * * * * www-data /usr/share/cacti/site/poller.php >/dev/null 2>/var/log/cacti/poller-error.log
Sascha
PHP Safe Mode Problem
OK I've got teh same problem and have succefully fixt teh problem by disabling Safe Mode in php.ini - but this is pretty insecure no?
Again the error I'm getting is this:
sh: /rrdtool: No such file or directory
I was also getting the same error for /php but I fixed that by creating a .bash_profile and .bashrc for teh user 'catiuser' (something I'm also a little uncomfortable with - I usually use a /bin/nologin for users such as this...
Anyway the question I'm asking is - is there a a *safer* way to do this?
environment:
Madriva Linux 2006 rrdtool-1.2.15
Again the error I'm getting is this:
sh: /rrdtool: No such file or directory
I was also getting the same error for /php but I fixed that by creating a .bash_profile and .bashrc for teh user 'catiuser' (something I'm also a little uncomfortable with - I usually use a /bin/nologin for users such as this...
Anyway the question I'm asking is - is there a a *safer* way to do this?
environment:
Madriva Linux 2006 rrdtool-1.2.15
Here is the quick fix I'm using:
Open poller.php and change the first line to:
Then scroll down to around line 99 and find the current block of code:
Change
To
Not the best solution, but you don't have to disable safe_mode for your whole site this way.
Open poller.php and change the first line to:
Code: Select all
#!/path/to/php -d safe_mode=off -q
Code: Select all
/* Determine Command Name */
if ($poller == "2") {
$command_string = read_config_option("path_cactid");
$extra_args = "";
$method = "cactid";
chdir(dirname(read_config_option("path_cactid")));
}else if ($config["cacti_server_os"] == "unix") {
$command_string = read_config_option("path_php_binary");
$extra_args = "-q " . $config["base_path"] . "/cmd.php";
$method = "cmd.php";
}else{
$command_string = read_config_option("path_php_binary");
$extra_args = "-q " . strtolower($config["base_path"] . "/cmd.php");
$method = "cmd.php";
}
Code: Select all
$extra_args = "-q " . $config["base_path"] . "/cmd.php";
and
$extra_args = "-q " . strtolower($config["base_path"] . "/cmd.php");
Code: Select all
$extra_args = "-d safe_mode=off -q " . $config["base_path"] . "/cmd.php";
and
$extra_args = "-d safe_mode=off -q " . strtolower($config["base_path"] . "/cmd.php");
Who is online
Users browsing this forum: No registered users and 0 guests