PIA 2.0 issues - HELP !

Support for the Plugin Architecture

Moderators: Developers, Moderators

mcutting
Cacti Guru User
Posts: 1884
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

PIA 2.0 issues - HELP !

Post by mcutting »

HELP !!!

I managed to get the PIA working on 0.8.7b, but now have

CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1064', SQL:"REPLACE INTO settings (name, value) VALUES ('url_path', 'Cacti\')'

In the logs every 10 seconds - I have set the url_path variable in plugins.php as suggested, and everything seems to work, with the exception of this error.

Any ideas ?
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Re: PIA 2.0 issues - HELP !

Post by fmangeant »

mcutting wrote:I have set the url_path variable in plugins.php as suggested, and everything seems to work, with the exception of this error.
How did you modify include/plugins.php ?
[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]
mcutting
Cacti Guru User
Posts: 1884
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

Post by mcutting »

Thanks for the prompt reply:

By adding the line

$config['url_path'] = '/cacti/';

Above the following (as suggested in another post)

define('URL_PATH', $config['url_path']);
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
mcutting
Cacti Guru User
Posts: 1884
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

Post by mcutting »

Anyone have any ideas on this ?

Thanks
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
mcutting
Cacti Guru User
Posts: 1884
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

Post by mcutting »

Solved this one myself - comment out the following lines in include\plugins.php

Code: Select all

if (isset($_SERVER['DOCUMENT_ROOT']) && isset($_SERVER['REMOTE_ADDR'])) {
	$config['url_path'] = substr(__FILE__, strlen($_SERVER['DOCUMENT_ROOT']), strlen(__FILE__) - strlen($_SERVER['DOCUMENT_ROOT']) - strlen('include/plugins.php'));
	db_execute("REPLACE INTO settings (name, value) VALUES ('url_path', '" . $config['url_path'] . "')");
} else {
	$config['url_path'] = db_fetch_cell("SELECT value FROM settings WHERE name = 'url_path'");
}
This seems to have resolved it - not sure if this breaks anything else - everything seems to work as it should.

Hope this may help someone else.
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
User avatar
johnrembo
Cacti User
Posts: 216
Joined: Mon Apr 24, 2006 3:33 am

Post by johnrembo »

mcutting wrote:Solved this one myself - comment out the following lines in include\plugins.php

Code: Select all

if (isset($_SERVER['DOCUMENT_ROOT']) && isset($_SERVER['REMOTE_ADDR'])) {
	$config['url_path'] = substr(__FILE__, strlen($_SERVER['DOCUMENT_ROOT']), strlen(__FILE__) - strlen($_SERVER['DOCUMENT_ROOT']) - strlen('include/plugins.php'));
	db_execute("REPLACE INTO settings (name, value) VALUES ('url_path', '" . $config['url_path'] . "')");
} else {
	$config['url_path'] = db_fetch_cell("SELECT value FROM settings WHERE name = 'url_path'");
}
This seems to have resolved it - not sure if this breaks anything else - everything seems to work as it should.

Hope this may help someone else.
indeed, $url_path is being reported incorrectly. in my case it cut's away first three symbols
"cti/"
instead of
"/cacti/"
mcutting
Cacti Guru User
Posts: 1884
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

Post by mcutting »

JohnRembo - this was the same case for me. Commenting these lines has no affect on CACTI, and I can confirm that everything seems to work as it should.
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
User avatar
johnrembo
Cacti User
Posts: 216
Joined: Mon Apr 24, 2006 3:33 am

Post by johnrembo »

mcutting wrote:JohnRembo - this was the same case for me. Commenting these lines has no affect on CACTI, and I can confirm that everything seems to work as it should.
yep, did this...by responding here I just wanted to be included on the list :wink:
sepp
Posts: 47
Joined: Thu Jun 21, 2007 6:50 am
Location: germany

Post by sepp »

hr... any idea on this one?

Code: Select all

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...
sepp
Posts: 47
Joined: Thu Jun 21, 2007 6:50 am
Location: germany

Post by sepp »

nobody? no ideas?

thx
srossen
Posts: 43
Joined: Mon Jun 13, 2005 1:10 pm

Post by srossen »

sepp wrote:hr... any idea on this one?

Code: Select all

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 that, did not find the missing ")" (if that is even what the problem is) so I just rolled back a version until I have time to look at it.
srossen
Posts: 43
Joined: Mon Jun 13, 2005 1:10 pm

Post by srossen »

sepp wrote:hr... any idea on this one?

Code: Select all

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
sepp
Posts: 47
Joined: Thu Jun 21, 2007 6:50 am
Location: germany

Post by sepp »

hey, thanks for the help. where did you change the path?
sepp
Posts: 47
Joined: Thu Jun 21, 2007 6:50 am
Location: germany

Post by sepp »

hi, still I have the problem

Fatal error: Call to undefined function api_plugin_hook() in /usr/share/cacti/site/include/global_arrays.php on line 620

I wonder where this function is defined? I commented the call to the function out in each file, cacti was complaining. of course it didn't help. But if I know where the function should be defined....

Am I the only one with this problem? I tried several ways of getting my nice plugins back, but nothing works... drives me crazy

thanks,

//seb
sygo
Posts: 1
Joined: Wed Mar 26, 2008 12:39 pm

Post by sygo »

sepp wrote:hi, still I have the problem

Am I the only one with this problem?

//seb
No, you are not the only one :-?
I have also the same problem and haven't found any issue.

I search and did not find anything else yet.

Have you got a solution for this problem?
I have used the http://cactiusers.org/downloads/cacti-p ... rch.tar.gz
on Cacti Version 0.8.7b.
My OS is ubuntu gutsy.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests