Friday, December 23, 2011

Cacti > Installing Plugin Architecture

The Plugin Architecture (PIA) is a set of code changes to core cacti. It is provided by Jimmy Conner (cigamit), one of the Cacti core developers. The Plugin Architecture for Cacti was designed to be both simple in nature and robust enough to allow freedom to do almost anything in Cacti. Cacti itself is designed nicely enough that integrating into it is fairly easy with very little modifications necessary (from here).

In simple terms for us users, it is simply a requirement in order to make the Cacti Plugins work.

Keep in mind that this procedure works on the following versions and on the environment I'm working with, see: My System

***Important Version Compatibility***

cacti_0.8.7g
cacti-plugin-0.8.7g-PA-v2.8

Before doing anything, backup your cacti-root-folder just in case you screwed up while making changes on your system.

1. Download cacti-plugin-arch and extract

#cd /opt
#wget http://mirror.cactiusers.org/downloads/plugins/cacti-plugin-0.8.7g-PA-v2.8.tar.gz
#tar -xzvf cacti-plugin-0.8.7g-PA-v2.8.tar.gz

2. Copy patch file to /var/www and perform patch

#cd cacti-plugin-arch
#cp cacti-plugin-0.8.7g-PA-v2.8.diff /var/www
#cd /var/www/cacti
#patch -p1 -N < /var/www/cacti-plugin-0.8.7g-PA-v2.8.diff

3. Edit include/config.php, and change database credentials

#vi /var/www/cacti/include/config.php

Update "url_path"

$url_path = "/cacti/";

4. Configure Plugin Architecture

- login to Cacti
- User Management > Admin > Realm Permission
- "check" the Plugin Management
- Done

5. Copy pa.sql on cacti webroot directory and execute import command

#cp pa.sql /var/www/cacti
#mysql -u cacti -p cacti < pa.sql



Plugin Management should now be found on the left panel of your Cacti page

In some cases, you may encounter errors such as this:

ERROR 1045 (28000): Access denied for user 'cacti'@'localhost' (using password: YES)

Execute the following commands to get rid of this error.

#cd /var/www/cacti
#mysql cacti < pa.sql
#mysql --user=root mysql

mysql> GRANT ALL ON cacti.* TO cacti@localhost IDENTIFIED BY 'cacti';
mysql> flush privileges;
mysql> exit

#mysql -u cacti -p cacti < pa.sql
NOTE: on mysql command line, replace the "cacti" with your "cactiuser" if you are using different user for your system

After doing this, you are now ready to install some of the important plugins such as "realtime", "monitor", "threshold", "spikekill", etc.

2 comments:

  1. Can you please tell the suitable PA version for cacti 0.8.7e ?

    ReplyDelete
  2. I do the patch into Version 0.8.8b .
    How to rollback?

    ReplyDelete