PIA 2.9 & fresh install of Cacti 0.8.7g

Support for the Plugin Architecture

Moderators: Developers, Moderators

Post Reply
User avatar
kramsay
Posts: 35
Joined: Fri Jan 21, 2005 1:42 pm

PIA 2.9 & fresh install of Cacti 0.8.7g

Post by kramsay »

Guys

I'd really appreciate some help. I have spent the two days using Thomas Urban's book to try and install a fresh copy of Cacti 0.8.7g and also the new 2.9 PIA from http://www.cacti.net/downloads/pia as detailed in the book. I used a fresh copy of RedHat 5.6 as well as a fresh install of MySQL . Cacti 0.8.7g was installed as normal and functions correctly. All patches were applied.

Next (as per page 168) I ran the patch command for the PIA, copied the poller.php and the data_sources.php and imported the pa.sql. I also checked that the $url_path is set to "/cacti/". Next I set the realm perms for the plugin management. So far all fine. I then download the settings-v0.7-1.tgz & the thold-latest.tgz files, and uncompress them in the plugins dir & set a sym link to thold. the Plugins appear and I install them as normal and all looks good. Thold realm permissions are also all checked
cacti-8.7g_plugins.JPG
cacti-8.7g_plugins.JPG (51.67 KiB) Viewed 3881 times
cacti_realm.JPG
cacti_realm.JPG (35.77 KiB) Viewed 3881 times



However when I then select the Thold tab I can see the normal thold text but all the links to the blue tabs are broken and I see only text at the top of the screen and no normal blue tabs
cacti-8.7g_plugins_thold.JPG
cacti-8.7g_plugins_thold.JPG (73.51 KiB) Viewed 3881 times
I have reinstalled everything completely from scratch 4 times now and getting a little frustrated so would appreciate some guidance. The last symptom I have is that each time I click on the Thold tab I get an error in the log file saying that the "SELECT * FROM thold_data..." failed.
cacti_thold_error.JPG
cacti_thold_error.JPG (177.34 KiB) Viewed 3881 times

I looked inside the database and that table is empty.

Code: Select all

| thold_data                     |
| thold_template                 |
| user_auth                      |
| user_auth_perms                |
| user_auth_realm                |
| user_log                       |
| version                        |
+--------------------------------+
58 rows in set (0.00 sec)

mysql> SELECT * FROM thold_data LEFT JOIN user_auth_perms ON ((thold_data.graph_id=user_auth_perms.item_id and user_auth_perms.type=1 and user_auth_perms.user_id=1) OR (thold_data.host_id=user_auth_perms.item_id and user_auth_perms.type=3 and user_auth_perms.user_id=1) OR (thold_data.graph_template=user_auth_perms.item_id and user_auth_perms.type=4 and user_auth_perms.user_id=1)) WHERE thold_data.thold_alert!=0 AND ((user_auth_perms.type != 1 OR user_auth_perms.type is null) AND ((user_auth_perms.type != 3) OR (user_auth_perms.type is null)) AND ((user_auth_perms.type != 4) OR (user_auth_perms.type is null))) ORDER BY name ASC LIMIT 0;SELECT * FROM thold_data
Empty set (0.00 sec)

    -> ;
Empty set (0.00 sec)

mysql> SELECT * FROM thold_data;
Empty set (0.00 sec)

mysql> SELECT * FROM thold_template;
Empty set (0.00 sec)

I have searched the forums and see others have had this problem but it seems to be related to old references being left in the database or not having imported the pa.sql. hopefully I have given you enough info to pinpoint my issue. I REALLy want to move on with this .. :o
=(8-0-)
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: PIA 2.9 & fresh install of Cacti 0.8.7g

Post by noname »

kramsay wrote:However when I then select the Thold tab I can see the normal thold text but all the links to the blue tabs are broken and I see only text at the top of the screen and no normal blue tabs
Probably you've forgotten to edit "$url_path" in 'include/config.php'.
User avatar
kramsay
Posts: 35
Joined: Fri Jan 21, 2005 1:42 pm

Re: PIA 2.9 & fresh install of Cacti 0.8.7g

Post by kramsay »

As I said above
I also checked that the $url_path is set to "/cacti/".
[root@testbox include]# cat config.php
<?php
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2010 The Cacti Group | :
removed for clarity
*/

/* make sure these values refect your actual database/host/user/password */
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "cactiuser";
$database_port = "3306";

/* load up old style plugins here */
$plugins = array();
//$plugins[] = 'thold';

/* Default session name - Session name must contain alpha characters */
#$cacti_session_name = "Cacti";

$config['url_path'] = '/cacti/'
?>
=(8-0-)
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: PIA 2.9 & fresh install of Cacti 0.8.7g

Post by noname »

kramsay wrote: I also checked that the $url_path is set to "/cacti/".
Oh sorry, I overlooked that.
User avatar
kramsay
Posts: 35
Joined: Fri Jan 21, 2005 1:42 pm

Re: PIA 2.9 & fresh install of Cacti 0.8.7g

Post by kramsay »

Ok I can see WHY the problem is happening but I am puzzled as to why ! Hopefully one of you smart guys will instantly know the issue from my next symptom description..

The reason the buttons disappear is that the underlying html target reference changes once I click on a plugin tab. The screenshot of the underlying html clearly shows the issue. Here is my good cacti host ( 0.8.7.e ) and you can see all the references have a forward slash '/' i.e. referenced from the root directory
cacti_plug1_work.JPG
cacti_plug1_work.JPG (121.62 KiB) Viewed 3852 times
and the references once i click on a plugin with 0.8.7g & the new PIA 2.9 seem to miss out the forward slash '/' and so the references are from the current directory.
cacti_plug_bad.JPG
cacti_plug_bad.JPG (67.34 KiB) Viewed 3852 times
so I have played with the document root in httpd.conf by adding and subtracting the trailing slash to no avail. I have changed the '/cacti/' in config.php to '/cacti' to no avail. Obviously I have restarted httpd each time. i know config.php is right because if I deliberately mess it up NOTHING works properly. If it is right then it is ONLY the plugin tabs references that get screwed up.

This must be SO obvious to one of you experts. Please assist ...
=(8-0-)
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: PIA 2.9 & fresh install of Cacti 0.8.7g

Post by noname »

kramsay wrote:As I said above
I also checked that the $url_path is set to "/cacti/".
[root@testbox include]# cat config.php
...
$config['url_path'] = '/cacti/'
So sorry, I overlooked again.

Please use $url_path instead of $config['url_path'] since 0.8.7g.
User avatar
kramsay
Posts: 35
Joined: Fri Jan 21, 2005 1:42 pm

Re: PIA 2.9 & fresh install of Cacti 0.8.7g

Post by kramsay »

Thankyou noname, thankyou. That was it. I really can't believe I couldn't find that information anywhere. I searched again and I can see that http://forums.cacti.net/viewtopic.php?f=21&t=41489 says the same thing.

I wonder why is this not more clearly documented or maybe included in the 2.9 PIA patch process? I spent a lot of frustrating time on searching and rebuilding . Kinda reminds me why I hated programming at college :lol:

Anyway thanks again for getting me back on track.
=(8-0-)
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: PIA 2.9 & fresh install of Cacti 0.8.7g

Post by phalek »

Hi kramsay ( btw, you're Ken from LinkedIn ? If yes, thanks for that post :-) )

In Chapter 8 ( Plugin Architecture ) it says ( Page 168 ):

Code: Select all

...
11. In case of errors, you can copy the already patched files from the
  cacti-plugin-arch/files-0.8.7g/ directory:
  cp cacti-plugin-arch/files-0.8.7g/poller.php .
  cp cacti-plugin-arch/files-0.8.7g/data_sources.php .
12. Import the additional SQL statements:
  mysql -u root -p cacti < cacti-plugin-arch/pa.sql
13. Check your config.php file for any settings that may have changed. The following
  line in particular should be checked:
  $url_path = "/cacti/";
So you probably missed step 13 then ...

Thomas Urban aka phalek ...
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests