Cacti (home)ForumsDocumentation

Install and Configure Cacti

  1. Extract the distribution tarball. Untar to the DOCUMENT_ROOT of your web server
    shell> tar xzvf cacti-version.tar.gz
  2. Create the MySQL database:
    shell> mysqladmin --user=root -p create cacti
  3. Import the default cacti database:
    shell> mysql cacti < cacti.sql
  4. Optional: Create a MySQL username and password for Cacti.
    shell> mysql --user=root mysql
    mysql> GRANT ALL ON cacti.* TO [email protected] IDENTIFIED BY 'somepassword';
    mysql> flush privileges;
  5. Edit “include/config.php” and specify the database type, name, host, user and password for your Cacti configuration.
    $database_type = "mysql";
    $database_default = "cacti";
    $database_hostname = "localhost";
    $database_username = "cactiuser";
    $database_password = "cacti";
    /* load up old style plugins here */
    $plugins = array();
    //$plugins[] = 'thold';
       Edit this to point to the default URL of your Cacti install
       ex: if your cacti install as at http://serverip/cacti/ this
       would be set to /cacti/
    $url_path = "/cacti/";
    /* Default session name - Session name must contain alpha characters */
    #$cacti_session_name = "Cacti";

    The $plugins array is required for using the Plugin Architecture (PIA) only. For legacy plugins, those that must be installed in global.php, we have moved the plugins array out of global.php and into config.php. This was done to insure that global.php remains pristine. It is a file that is not intended to be modified, so with the PIA installed, you should not have to.
    The variable “URL_PATH” has also been moved from global.php to config.php for the same reason as the plugins array. For those of you upgrading from very old Plugin Architectures you should know that in the past, we attempted to “detect” this path. However, the process was not reliable. Therefore, you have to specify that path in config.php.

  6. Set the appropriate permissions on cacti's directories for graph/log generation. You should execute these commands from inside cacti's directory to change the permissions.
    shell> chown -R cactiuser rra/ log/

    (Enter a valid username for cactiuser, this user will also be used in the next step for data gathering.)

  7. Add a line to your ”/etc/crontab” file similar to1):
    */5 * * * * cactiuser php /var/www/html/cacti/poller.php > /dev/null 2>&1

    Replace cactiuser with the valid user specified in the previous step.Replace ”/var/www/html/cacti/” with your full Cacti path.

  8. Make sure, that the crond cron daemon is running as given by Start System Services for Cacti.
  9. Point your web browser to: http://your-server/cacti in the with a username/password of admin. You will be required to change this password immediately. Make sure to fill in all of the path variables carefully and correctly on the following screen.
1) If you are installing from a distro specific package, ensure that a crontab entry has note already been created by the package installatin routine

Personal Tools