config["*_path"] don't get expanded

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

Moderators: Developers, Moderators

Post Reply
floyd_n_milan
Posts: 11
Joined: Thu May 10, 2007 5:15 am
Contact:

config["*_path"] don't get expanded

Post by floyd_n_milan »

Hi,

I installed or tried to install cacti on a Fedora Core 6 box. First I used the rpm in the extras repository and then I used the official tarball. I have this same problem for both methods.

I followed the installation documentation and configured apache and mysql etc. Upon browsing http://localhost/cacti I got a blank page. Looking at my httpd error_log, I found the following:

Code: Select all

[Thu May 10 16:31:25 2007] [error] [client 127.0.0.1] PHP Warning:  mb_ereg_replace() [<a href='function.mb-ereg-replace'>function.mb-ereg-replace</a>]: mbregex compile err: premature end of char-class in /usr/share/cacti/include/config.php on line 57
[Thu May 10 16:31:25 2007] [error] [client 127.0.0.1] PHP Warning:  mb_ereg_replace() [<a href='function.mb-ereg-replace'>function.mb-ereg-replace</a>]: mbregex compile err: premature end of char-class in /usr/share/cacti/include/config.php on line 58
[Thu May 10 16:31:25 2007] [error] [client 127.0.0.1] PHP Warning:  include(/adodb/adodb.inc.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory in /usr/share/cacti/include/config.php on line 142
[Thu May 10 16:31:25 2007] [error] [client 127.0.0.1] PHP Warning:  include() [<a href='function.include'>function.include</a>]: Failed opening '/adodb/adodb.inc.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /usr/share/cacti/include/config.php on line 142
[Thu May 10 16:31:25 2007] [error] [client 127.0.0.1] PHP Warning:  include(/database.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory in /usr/share/cacti/include/config.php on line 143
[Thu May 10 16:31:25 2007] [error] [client 127.0.0.1] PHP Warning:  include() [<a href='function.include'>function.include</a>]: Failed opening '/database.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /usr/share/cacti/include/config.php on line 143
[Thu May 10 16:31:25 2007] [error] [client 127.0.0.1] PHP Warning:  include_once(/functions.php) [<a href='function.include-once'>function.include-once</a>]: failed to open stream: No such file or directory in /usr/share/cacti/include/config.php on line 144
[Thu May 10 16:31:25 2007] [error] [client 127.0.0.1] PHP Warning:  include_once() [<a href='function.include'>function.include</a>]: Failed opening '/functions.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /usr/share/cacti/include/config.php on line 144
[Thu May 10 16:31:25 2007] [error] [client 127.0.0.1] PHP Fatal error:  Call to undefined function db_connect_real() in /usr/share/cacti/include/config.php on line 150
So I made the following changes in include/config.php:

Code: Select all

$config["library_path"] = "/usr/share/cacti/lib";
#$config["library_path"] = ereg_replace("(.*[\/\\])include", "\\1lib", dirname(__FILE__));
After this, I got the installation pages. The first sign of trouble, although I didn't notice it at first was on the `Cacti Installation Guide' page.

Code: Select all

[NOT FOUND] Cacti Log File Path: The path to your Cacti log file.
/log/cacti.log
I had made sure that that file existed and that the permissions were proper before ever proceeding with the installation. I put in the absolute path, proceeded with the installation and then logged in. Upon logging in, I couldn't see any graphs. So I checked the cron file and made the appropriate changes.

Then I did an `su - cacti' and manually ran the poller.php script. Here's the output:

Code: Select all

PHP Warning:  mb_ereg_replace(): mbregex compile err: premature end of char-class in /usr/share/cacti/include/config.php on line 57
PHP Warning:  include_once(/lib/poller.php): failed to open stream: No such file or directory in /usr/share/cacti/poller.php on line 38
PHP Warning:  include_once(): Failed opening '/lib/poller.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /usr/share/cacti/poller.php on line 38
PHP Warning:  include_once(/lib/data_query.php): failed to open stream: No such file or directory in /usr/share/cacti/poller.php on line 39
PHP Warning:  include_once(): Failed opening '/lib/data_query.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /usr/share/cacti/poller.php on line 39
PHP Warning:  include_once(/lib/graph_export.php): failed to open stream: No such file or directory in /usr/share/cacti/poller.php on line 40
PHP Warning:  include_once(): Failed opening '/lib/graph_export.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /usr/share/cacti/poller.php on line 40
PHP Warning:  include_once(/lib/rrd.php): failed to open stream: No such file or directory in /usr/share/cacti/poller.php on line 41
PHP Warning:  include_once(): Failed opening '/lib/rrd.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /usr/share/cacti/poller.php on line 41
PHP Fatal error:  Call to undefined function exec_background() in /usr/share/cacti/poller.php on line 128
So it seems to me that the config["*_path"] variables are not being expanded properly.

The package versions are as follows:

php-5.1.6-3.5.fc6
php-mysql-5.1.6-3.5.fc6
php-snmp-5.1.6-3.5.fc6
mysql-5.0.22-2.1
mysql-server-5.0.22-2.1
httpd-2.2.3-5

Any help is greatly appreciated.

Thanks. :)

P.S.

Code: Select all

Data Query Debug Information
+ Running data query [6].
+ Found type = '4 '[script query].
+ Could not find data query XML file at '/resource/script_queries/unix_disk.xml'
+ Error parsing XML file into an array.
+ Could not find data query XML file at '/resource/script_queries/unix_disk.xml'
+ Could not find data query XML file at '/resource/script_queries/unix_disk.xml'
+ Could not find data query XML file at '/resource/script_queries/unix_disk.xml'
Hmmm.
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

Hi

is SELinux enabled on this server ?
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
floyd_n_milan
Posts: 11
Joined: Thu May 10, 2007 5:15 am
Contact:

Post by floyd_n_milan »

fmangeant wrote:Hi

is SELinux enabled on this server ?
I thought of that and as far as I remember, no, I had disabled it. I'll double check again tomorrow.

Any other guesses? I'm going to try and install it on my Gentoo box now. Let's see..
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

Could you try that :

Code: Select all

mbstring.func_overload=0
in php.ini ?
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
floyd_n_milan
Posts: 11
Joined: Thu May 10, 2007 5:15 am
Contact:

Post by floyd_n_milan »

fmangeant wrote:Could you try that :

Code: Select all

mbstring.func_overload=0
in php.ini ?
Sure, but that'll have to wait till I get to work tomorrow. :)

Meanwhile, proceeding with the installation on my home Gentoo box.
floyd_n_milan
Posts: 11
Joined: Thu May 10, 2007 5:15 am
Contact:

Post by floyd_n_milan »

Its working perfectly on my Gentoo box. I'll have to check what's wrong on FC6. I checked php.ini on Gentoo and this is what I have:

Code: Select all

;mbstring.func_overload = 0
Apparently its commented out. I'll post what happens on the FC6 box at work in a few hours.

Thanks for your help so far :)
floyd_n_milan
Posts: 11
Joined: Thu May 10, 2007 5:15 am
Contact:

Post by floyd_n_milan »

SELinux is disabled.

mbstring.func_overload was initially set to 7 on FC6. I changed it to 0. I also changed config.php to its original state. Restarted apache. Then I ran poller.php as cacti, I got this:

Code: Select all

Can't open perl script "/scripts/linux_memory.pl": No such file or directory
Can't open perl script "/scripts/linux_memory.pl": No such file or directory
Can't open perl script "/scripts/loadavg_multi.pl": No such file or directory
Can't open perl script "/scripts/unix_users.pl": No such file or directory
Can't open perl script "/scripts/unix_processes.pl": No such file or directory
05/11/2007 10:23:25 AM - SYSTEM STATS: Time:1.0840 Method:cmd.php Processes:1 Threads:N/A Hosts:2 HostsPerProcess:2 DataSources:5 RRDsProcessed:5
ERROR: opening '/rra/localhost_mem_buffers_3.rrd': No such file or directory
ERROR: opening '/rra/localhost_mem_swap_4.rrd': No such file or directory
ERROR: Not enough arguments
ERROR: opening '/rra/localhost_users_6.rrd': No such file or directory
ERROR: opening '/rra/localhost_proc_7.rrd': No such file or directory
floyd_n_milan
Posts: 11
Joined: Thu May 10, 2007 5:15 am
Contact:

Post by floyd_n_milan »

Update:

It's working perfectly now. Thanks a lot and allow me to congratulate you on a great piece of software. The code is beautifully written. Cheers. I'd love to help out when I know enough PHP.

Thanks again.
colintanlk
Posts: 1
Joined: Wed May 16, 2007 7:55 pm

Poller.Php

Post by colintanlk »

I have exactly the same problem. What did you do to get it working?
floyd_n_milan
Posts: 11
Joined: Thu May 10, 2007 5:15 am
Contact:

Post by floyd_n_milan »

I did exactly what was suggested.

mbstring.func_overload=0 in php.ini.

I restarted apache after this, but still had the same problem. The I restarted it again and the problem magically disappeared!
Mrugesh Karnik
System Administrator
Silver Arc Solutions (India) Pvt. Ltd.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest