Installing cacti on aws

Cacti is a absolute frontend to RRDTool, it stores all of the necessary information to plot graphs and populate them with data in  MySQL database. The frontend is particularly  PHP driven. Along with being able to maintain Graphs, Data Sources, and Round Robin Archives in a database, cacti control the data gathering.



Cacti requires that the following software is installed on your system.

  • RRDTool 1.0.49 or greater, 1.4+ recommended
  • MySQL 5.x or greater
  • PHP 5.1 or greater
  • Web Server that supports PHP e.g. Apache or IIS


Basically if we talk about AWS we require EC2 instance with LAMP role.

To configure EC2 instance in Lamp role please refer following link.



Required Packages for RPM-based Operating Systems

  • httpd
  • php
  • php-mysql
  • php-snmp
  • mysql
  • mysql-server
  • net-snmp




Now please refer to the following reference to configure PHP.


Now please refer the following reference to configure apache.


Now we need to use the RDS feature of AWS to configure the mysql and then bind it to the EC2 instance ip.

To do RDS configuration on AWS please follow the following reference.


After successful installation of RDS installation and doing the bind configuration.


Install and Configure Cacti

  • Extract the distribution tarball.

shell> tar xzvf cacti-version.tar.gz

  • Create the MySQL database:

shell> mysqladmin –user=root create cacti

  • Import the default cacti database:

shell> mysql cacti < cacti.sql

  • Optional: Create a MySQL username and password for Cacti.

shell> mysql –user=root mysql·        mysql> GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY ‘somepassword’;mysql> flush privileges;

  • 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”;

  • 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.)

  • Add a line to your /etc/crontab file similar to:

*/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.

Point your web browser to:


Log 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.

Leave a Reply

Your email address will not be published.