After going through some changes, for both files, the Cacti Plugin Architecture was installed and we may hereafter install plugins easily. The main point is changing some of the global.php, config.php and /etc/cacti/debian.php files. In the documentation debian.php file is not mentioned but it definitely affects the way PIA works. Only this link mentions briefly (cnrz @ How To Install Plugin Architecture on Ubuntu 9.10 Server ?!
). There may be additional methods but since this is working we think it may be used for Ubuntu Server 10.10.
The Installation consists of:
1. copying the PIA from cactiusers.org by: wget http://mirror.cactiusers.org/downloads/ ... 2.8.tar.gz
2. tar -zxvf cacti-plugin-0.8.7g-PA-v2.8.tar.gz
3. sudo cp cacti-plugin-arch/* /usr/share/cacti/site/ -R
4. Goto the folder cacti-plugin-arch (which you extracted from the download). In this folder is the pa.sql.Import the pa.sql file to the cacti database. If this is not done, graphics are not seen on the cacti web site:
/usr/local/mysql/bin/mysql --user=root --password=rootpw cacti < pa.sql (or mysql cacti < pa.sql -u root -p rootpw). Here you should write the root password given during the installation instead of rootpw.
The Changes made from the original installation files coming within cacti-plugin-0.8.7g-PA-v2.8.tar file is as follows: (Other lines left exactly the same, just copy them to /usr/share/cacti/site
STEP1: Change /usr/share/cacti/site/include/global.php as follows:
/* Line 37 $database_username = "cactiuser"; */
$database_username = "cacti";
/* Line 38 $database_password = "cactiuser"; */
$database_password = "enter your pass given during installation(not cactiuser)";
/Line 105 *$config['url_path'] = $url_path;*/
$config["url_path"] = '/cacti/';
/* Line 112 $config["rra_path"] = $config["base_path"] . '/rra';*/
$config["rra_path"] = "/var/lib/cacti/rra";
/* Line 202 include($config["library_path"] . "/adodb/adodb.inc.php");*/
STEP2: Change /usr/share/cacti/site/include/config.php as follows:
config.php is as follows (we don't do any changes in this file, all the additions are made to the debian.php file, but the patch file requires some changes to be made, we did the database setting
configuration on the /etc/cacti/debian.php file. $url_path = "/"; parameter is also changed on the global.php file.
/* make sure these values refect your actual database/host/user/password */
$database_type = "mysql";
/* Default session name - Session name must contain alpha characters */
#$cacti_session_name = "Cacti";
/* load up old style plugins here */
$plugins = array();
STEP3: Change /etc/cacti/debian.php
/* Lines 14 and 15 */
$database_password='enter your pass given during the installation';
Add the following lines:
/* load up old style plugins here. You need to enter some old style plugins like syslog, but for new plugins you don't need to enter them here, by default they appear on plugin management link on the left */
$plugins = array();
$plugins = ‘ntop’;
Also, as a second alternative method to the above procedure, just use the patch command, but before using this command make sure that apache2 and mysql services are stopped with /etc/init.d/apache2 stop, and /etc/init.d/mysql stop.
1. Copy the cacti-plugin-arch.diff file to /usr/share/cacti/site with sudo cp cacti-plugin-arch.dif /usr/share/cacti/site command
patch -p1 -N --dry-run < cacti-plugin-arch.diff (see this does not give any errors
patch -p1 -N < cacti-plugin-arch.diff
2. Import the pa.sql file to the cacti database. If this is not done,
graphics are not seen on the cacti web site.
/usr/local/mysql/bin/mysql --user=root --password=rootpw cacti < pa.sql
3. After patching don't forget to restart both apache2 and mysql with