Installing Cacti Plugin Architecture

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
phanthach

Installing Cacti Plugin Architecture

Post by phanthach »

There are two ways of install the Plugin Architecture. The first way is by using the patch files. A patch file contains the difference between the original files and the "new" files, which makes them very small as they only contain exactly what we need to make the changes. The other way is by using the pre-patched full files. These files are the full install of the necessary files with the patch already applied to them. With these you can directly override the files already in your Cacti directory. I only include the files that are necessary to change, so you don't have to override every file in your Cacti install.
Using the Pre-Patched Files

Using the pre-patched files is easiest and most straight forward way to install the Plugin Architecture. You will of course want to backup your Cacti install first before attempting any add-on modifications. Once you have backed up your install. Goto the directory that you extracted the Plugin Architecture to. In this directory you will find several other directories. One of them will look like this "files-0.8.6g". This is to show you that these are the pre-patched files for Cacti v0.8.6g, there may be other versions available if that is not your version.

Now you will need to determine where your original Cacti install is. For instance on Fedora Core 3, my original Cacti files are located at /var/www/html/. This will vary between Distributions and ofcourse between Linux and Windows, and it is outside the scope of this document to discover where your installation is placed. Once you have the location, remember where it is as you will need it shortly.

You will now copy the files from the "files-0.8.6g" directory to your Cacti install directory, overriding any files if you are prompted. There are several ways to copy the files over (Explorer in Windows, FTP, command line, ect.)

From here you are done installing the Plugin Architecture, but it is necessary to configure it first before you continue using Cacti (or Cacti will probably not function properly!)

Using the Patch

Using the patch files is slightly harder that using the pre-patched files, but it is recommended for anyone that has already modified their Cacti install using other mods, or their own custom tweaks. This is mostly used on Linux/Unix etc... but can also be done on Windows if you have the appropriate tools installed. You will ofcourse want to backup your Cacti install first before attempting any add-on modifications.

Now you will need to determine where your original Cacti install is. For instance on Fedora Core 3, my original Cacti files are located at <i>/var/www/html/</i>. This will vary between Distributions and ofcourse between Linux and Windows, and it is outside the scope of this document to discover where your installation is placed. Once you have the location, remember where it is as you will need it shortly.

Now goto the directory that you extracted the Plugin Architecture to. In this directory you will find several files with names simular to this "cacti-plugin-0.8.6g.diff". This is a patch file that contains everything you need to install the Plugin Architecture. You will copy the file that corresponds with your Cacti version to the location of your Cacti install using a command prompt (if you weren't already using one!)

We will first run this command from the Cacti Install directory

#patch -p1 -N --dry-run < cacti-plugin-arch.diff

This will not make any changes, it will only attempt to do the install and report back any errors. If you receive and FAILED errors, then you know that you will run into a few problems. These problems can usually be addressed by posting in the forums. If you have not modified your Cacti install by using any other mods, then it is usually fairly safe to override the file that "FAILED" with a pre-patched file that is also provided in the archive (See the directions above). Your config.php file will almost always fail to be patched if you have either already configured your database settings for Cacti, or you are using an RPM/DEB install (and possibly even the Windows MSI install). If so, then just override the file, and reconfigure it for your database.

To continue with the patching process, just run this command

#patch -p1 -N < cacti-plugin-arch.diff

This will modify the files and report back and errors. Assuming that all went well, then you can now proceed to configuring your Cacti install.

Configuration Cacti Plugin Architecture

It is necessary to configure your Cacti install after installing the Plugin Architecture for several reasons. First you will need to re-enter your database username and password (you can just pull the info out of your backup of your old includes/config.php). This is fairly straight forward and not necessary to cover here.

The other reason is that we now have a new config option which must be set inorder for your Cacti install to function properly. When you edit your includes/config.php you will see this option

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

You will need to set this option to the URL location of your Cacti install. For instance, if you Cacti Install was reachable through a web browser at this location.


Then it would not be necessary to modify the above default location. But if your Cacti Install was at


then you would need to set the option to this

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

It is important to note that you must include the '/' at the front and end of the location. This is to prevent other issues later down the road.

Once this is done, you will have successfully completed installing the Plugin Architecture. You will now want to proceed with downloading and install Plugins

Installing and Configuring Cacti Plugins

Installing Plugins

Plugins are made to be easy to install, upgrade and remove.Before you can begin to install a plugin as described above, you will need to install the Cacti Plugin Architecture. But once that is done, its all fairly simple.
______________________
Online Dating Reviews
personalized wedding favors
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests