Ad blocker detected: Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker on our website.
Fatal error: Call to undefined function api_plugin_hook() in /usr/share/cacti/site/include/global_arrays.php on line 620
I applied the sql file...
I got around to looking at this and used the pre-patched files and did not have this issue. I did have to change the path to adodb but now up and running fine on 0.8.7b and PIA 2.0
How did you change the adodb path, I seem to be having a similar error:
Warning: include(/usr/share/webapps/cacti/0.8.7b/htdocs/lib/adodb/adodb.inc.php) [function.include]: failed to open stream: No such file or directory in /usr/share/webapps/cacti/0.8.7b/htdocs/include/global.php on line 201
Warning: include() [function.include]: Failed opening '/usr/share/webapps/cacti/0.8.7b/htdocs/lib/adodb/adodb.inc.php' for inclusion (include_path='.:/usr/share/php5:/usr/share/php') in /usr/share/webapps/cacti/0.8.7b/htdocs/include/global.php on line 201
Fatal error: Call to undefined function NewADOConnection() in /usr/share/webapps/cacti/0.8.7b/htdocs/lib/database.php on line 38
I have a solution of this error. I installed cacti 0.8.7b-2 with plugin 2.2 and also this error has appeard:
Warning: include(/usr/share/webapps/cacti/0.8.7b/htdocs/lib/adodb/adodb.inc.php) [function.include]: failed to open stream: No such file or directory in /usr/share/webapps/cacti/0.8.7b/htdocs/include/global.php on line 201
Warning: include() [function.include]: Failed opening '/usr/share/webapps/cacti/0.8.7b/htdocs/lib/adodb/adodb.inc.php' for inclusion (include_path='.:/usr/share/php5:/usr/share/php') in /usr/share/webapps/cacti/0.8.7b/htdocs/include/global.php on line 201
Fatal error: Call to undefined function NewADOConnection() in /usr/share/webapps/cacti/0.8.7b/htdocs/lib/database.php on line 38
You have to copy adodb directory to cacti/site/lib/. This removes error. This folder you can download from kola.pl.pl
In global.php check your url path and rra path. In my case $config["rra_path"] = '/var/lib/cacti/rra';
I have the same matter but I think I found where it seems to be defined.
I know nothing about the php but in the file "/cacti/site/lib/plugin.php" there is this whitch seems to be au definition :
/**
* This function executes a hook.
* @param string $name Name of hook to fire
* @return mixed $data
*/
function api_plugin_hook($name) {
global $config, $plugin_hooks;
$data = func_get_args();
$ret = '';
$p = array();
$result = db_fetch_assoc("SELECT name, file, function FROM plugin_hooks WHERE status = 1 AND hook = '$name'", false);
if (count($result)) {
foreach ($result as $hdata) {
$p[] = $hdata['name'];
if (file_exists($config['base_path'] . '/plugins/' . $hdata['name'] . '/' . $hdata['file'])) {
include_once($config['base_path'] . '/plugins/' . $hdata['name'] . '/' . $hdata['file']);
}
$function = $hdata['function'];
if (function_exists($function)) {
$function($data);
}
}
}
if (isset($plugin_hooks[$name]) && is_array($plugin_hooks[$name])) {
foreach ($plugin_hooks[$name] as $pname => $function) {
if (function_exists($function) && !function_exists('plugin_' . $pname . '_install') && !in_array($pname, $p)) {
$function($data);
}
}
}
/* Variable-length argument lists have a slight problem when */
/* passing values by reference. Pity. This is a workaround. */
return $data;
}
It's best to use full files. There is no guarantee that the PIA will patch against someone else's distribution. So far with Cacti on Debian, it's a safe bet to install from source if you want to be successful unless you want to wait on the packager.
TheWitness
True understanding begins only when we realize how little we truly understand...