Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


PIA 2.0 issues - HELP !
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cacti Forum Index -> Plugin Architecture
Author Message
mcutting
Cacti Pro User


Joined: 16 Oct 2006
Posts: 978

PostPosted: Thu Feb 14, 2008 9:04 am    Post subject: PIA 2.0 issues - HELP ! Reply with quote

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 ?
Back to top
fmangeant
Cacti Guru User


Joined: 19 Sep 2003
Posts: 2325
Location: Sophia-Antipolis, France

PostPosted: Thu Feb 14, 2008 9:05 am    Post subject: Re: PIA 2.0 issues - HELP ! Reply with quote

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 ?
Back to top
mcutting
Cacti Pro User


Joined: 16 Oct 2006
Posts: 978

PostPosted: Thu Feb 14, 2008 9:07 am    Post subject: Reply with quote

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']);
Back to top
mcutting
Cacti Pro User


Joined: 16 Oct 2006
Posts: 978

PostPosted: Thu Feb 14, 2008 9:55 am    Post subject: Reply with quote

Anyone have any ideas on this ?

Thanks
Back to top
mcutting
Cacti Pro User


Joined: 16 Oct 2006
Posts: 978

PostPosted: Thu Feb 14, 2008 11:32 am    Post subject: Reply with quote

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

Code:
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.
Back to top
johnrembo
Cacti User


Joined: 24 Apr 2006
Posts: 198

PostPosted: Tue Feb 19, 2008 2:37 am    Post subject: Reply with quote

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

Code:
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
Quote:
"cti/"
instead of
Quote:
"/cacti/"
Back to top
mcutting
Cacti Pro User


Joined: 16 Oct 2006
Posts: 978

PostPosted: Tue Feb 19, 2008 2:49 am    Post subject: Reply with quote

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.
Back to top
johnrembo
Cacti User


Joined: 24 Apr 2006
Posts: 198

PostPosted: Tue Feb 19, 2008 7:04 am    Post subject: Reply with quote

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
Back to top
sepp



Joined: 21 Jun 2007
Posts: 47
Location: germany

PostPosted: Tue Feb 19, 2008 7:17 am    Post subject: Reply with quote

hr... any idea on this one?

Code:
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...
Back to top
sepp



Joined: 21 Jun 2007
Posts: 47
Location: germany

PostPosted: Wed Feb 20, 2008 3:09 am    Post subject: Reply with quote

nobody? no ideas?

thx
Back to top
srossen



Joined: 13 Jun 2005
Posts: 12

PostPosted: Wed Feb 20, 2008 3:26 pm    Post subject: Reply with quote

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

Code:
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.
Back to top
srossen



Joined: 13 Jun 2005
Posts: 12

PostPosted: Thu Feb 21, 2008 11:44 am    Post subject: Reply with quote

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

Code:
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
Back to top
sepp



Joined: 21 Jun 2007
Posts: 47
Location: germany

PostPosted: Fri Feb 22, 2008 3:43 am    Post subject: Reply with quote

hey, thanks for the help. where did you change the path?
Back to top
sepp



Joined: 21 Jun 2007
Posts: 47
Location: germany

PostPosted: Mon Feb 25, 2008 8:11 am    Post subject: Reply with quote

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
Back to top
sygo



Joined: 26 Mar 2008
Posts: 1

PostPosted: Wed Mar 26, 2008 12:43 pm    Post subject: Reply with quote

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-plugin-arch.tar.gz
on Cacti Version 0.8.7b.
My OS is ubuntu gutsy.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Plugin Architecture All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 



Powered by phpBB © 2001, 2005 phpBB Group