Cacti Install
The cacti Wiki is here to try and offer some helpful information on the install, setup, and configuration of Cacti. It is not complete by any means and will continue to be a work in progress. Currently this is about installing the latest version of cacti (0.8.7d) on Ubuntu 8.04/8.10. If you have anything to contribute feel free to email me or submit a comment.
Install Cacti on Ubuntu 8.04/8.10
Make sure you have installed LAMP.
Run the following command in terminal.
sudo apt-get install php5 php5-gd php5-mysql
Next install Cacti by running this command
sudo apt-get install cacti-cactid
Go to the cacti web interface. “http://localhost/cacti”
Walk through the steps of a new installation.
Download the new version of cacti from cacti.net. Extract the files and delete the “include/config.php” file. Rename the folder to site and copy the file to the cacti install directory. “/usr/share/cacti”
cp -R site /usr/share/cacti
Open the web interface and follow the steps for the cacti upgrade. If your graphs don’t show up after a couple minutes then you may have a permissions issue. See “Cacti Permissions Settings”
Cacti Default User Name and Password
username: admin
password: admin
Cacti install locations (Ubuntu 8.04/8.10)
The location that the cacti-cactid package installs cacti is /usr/share/cacti/site and /etc/cacti
Cacti permission settings (0.8.7d)
Permissions on the “site” folder should be set to 777 otherwise graphs will not appear. I’m sure there is a better setting for this but I haven’t tried it yet.
chmod 777 -R site
Installing Plugin Architecture on cacti
Download
The first step is to download the Plugin Architecture. You can get it in either zip or gzip compressed archives. You can find the download for it here.
http://cactiusers.org/downloads/patches/
Extract
You will need to extract this archive. On Windows there are several ways to extract zips/gzips, just use the program of your choice (ex: Winzip). Using Unix you can extract it using a command similar to this one, but your milage may vary depending on the Distribution you are running.
tar -zvxf cacti-plugin-arch.tar.gz
If all goes well, you should have a folder called cacti-plugin-arch with a few patch files and a folders in it. It does not matter in particular to where you download and extract these files to, as we will be moving just the files we need.
Installing
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…) so I will not go into that here.
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 “/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.
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
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/global.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 in order for your Cacti install to function properly. When you edit your includes/global.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.
http://servername/
Then it would not be necessary to modify the above default location. But if your Cacti Install was at
http://servername/projects/cacti/testing/
then you would need to set the option to this
$config['url_path'] = “/projects/cacti/testing/”;
or it may be located here
http://servername/cacti/
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. You can refer to Installing Plugins to help with it.
source: http://cactiusers.org/wiki/PluginArchitectureInstall
Activating Plugin Management
Import the pa.sql file with the following command:
mysql -u root -p cacti < pa.sql
Grant permissions to Plugin Management via the user management tool in the Cacti interface


#1 by KattyBlackyard on June 15, 2009 - 12:41 am
Great post! I’ll subscribe right now wth my feedreader software!