error after installing plug.

Support for the Plugin Architecture

Moderators: Developers, Moderators

Post Reply
sundelor
Posts: 3
Joined: Sun Oct 16, 2011 5:57 pm

error after installing plug.

Post by sundelor »

Hi all.
I'm using CentOs 6.0
cacti-0.8.7h & cacti-plugin-0.8.7h-PA-v3.0

pkg from site (tar.gz , not rpm)

after applying cacti-plugin-0.8.7h-PA-v3.0.diff and coping files. i has 500 error and this log from httpd:

Code: Select all

[Mon Oct 17 02:55:59 2011] [error] [client 192.168.1.142] PHP Fatal error:  Call to undefined function api_plugin_hook() in /var/www/cacti/include/global_arrays.php on line 698
line is:

Code: Select all

api_plugin_hook('config_arrays');
Any ideas? :)
Thx
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: error after installing plug.

Post by TheWitness »

Your global.php needs to be updated to the correct load order. Take the vanilla global.php from the PIA and install it. With Cacti 0.8.7g+ you should not have to touch global.php anyway. All the changes are in config.php.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
sundelor
Posts: 3
Joined: Sun Oct 16, 2011 5:57 pm

Re: error after installing plug.

Post by sundelor »

TheWitness, I changed global.php to default, change data in config.php

But error still appear...
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: error after installing plug.

Post by TheWitness »

Edit the <base_path>/include/global.php and see if lib/plugins.php is included before or after include/global_arrays.php.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
sundelor
Posts: 3
Joined: Sun Oct 16, 2011 5:57 pm

Re: error after installing plug.

Post by sundelor »

include/global.php

Code: Select all

/* include additional modules */
include_once($config["library_path"] . "/functions.php");
include_once($config["include_path"] . "/global_constants.php");
include_once($config["library_path"] . "/plugins.php");
include_once($config["include_path"] . "/plugins.php");
include_once($config["include_path"] . "/global_arrays.php");
include_once($config["include_path"] . "/global_settings.php");
include_once($config["include_path"] . "/global_form.php");
include_once($config["library_path"] . "/html.php");
include_once($config["library_path"] . "/html_form.php");
include_once($config["library_path"] . "/html_utility.php");
include_once($config["library_path"] . "/html_validate.php");
include_once($config["library_path"] . "/variables.php");
include_once($config["library_path"] . "/auth.php");

api_plugin_hook("config_insert");

Code: Select all


/* used for includes */
if ($config["cacti_server_os"] == "win32") {
        $config["base_path"]    = str_replace("\\", "/", substr(dirname(__FILE__),0,-8));
        $config["library_path"] = $config["base_path"] . "/lib";
}else{
        $config["base_path"]    = preg_replace("/(.*)[\/]include/", "\\1", dirname(__FILE__));
        $config["library_path"] = preg_replace("/(.*[\/])include/", "\\1lib", dirname(__FILE__));
}
$config["include_path"] = dirname(__FILE__);
$config["rra_path"] = $config["base_path"] . '/rra';
looks good, but I have CentOS, not Win...
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: error after installing plug.

Post by TheWitness »

Need more information. Can you start logging php to /tmp/php.log. Edit the php.ini file for both Apache and CLI. The setting is 'error_log=/tmp/php.log'. Restart apache afterwards. There needs to be some other error as I have not issues on Debian (Ubuntu), which is where I do most of my testing. RHEL6/CentOS6 is newer, but generally fine.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
russian.qwerty
Posts: 12
Joined: Wed Nov 25, 2009 9:08 am

Re: error after installing plug.

Post by russian.qwerty »

Dear colleagues,

I got the same error after installation PA v3.0 on fresh installation of Cacti 0.8.7h (tgz) on RHEL6.1 x86_64.

I just installed 0.8.7h (new installation), checked, and after that:

patch -p1 -N < cacti-plugin-arch/cacti-plugin-0.8.7h-PA-v3.0.diff
mysql -u cactiuser --password='password' cacti < cacti-plugin-arch/pa.sql

I didn't noticed any error. But after that http://hostname/cacti/ - HTTP error 500.

Code: Select all

tail -f /var/log/httpd/error_log
[Tue Oct 25 17:21:17 2011] [error] [client 192.168.1.2] PHP Fatal error:  Call to undefined function api_plugin_hook() in /var/www/html/cacti/include/global_arrays.php on line 698, referer: http://192.168.1.1/cacti/graphs.php?action=graph_edit&id=6
Some packets:
httpd-2.2.15-9.0.1.el6.x86_64
php-5.3.3-3.el6.x86_64

Please take a look on this problem.

Thank you in advance.
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: error after installing plug.

Post by TheWitness »

Install the PIA not from patches, but from the full files.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
russian.qwerty
Posts: 12
Joined: Wed Nov 25, 2009 9:08 am

Re: error after installing plug.

Post by russian.qwerty »

Dear TheWitness,

Thanks for help. I've just completely reinstall using patched files from tgz and problem is solved for now.

Please update this manual and cacti-plugin-arch/README file, if you please.

And thanks for your work.
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests