Home > Linux > Install and configure Cacti v0.8.7g on Ubuntu v10.04.1 step by step

Install and configure Cacti v0.8.7g on Ubuntu v10.04.1 step by step

On many occasions I am asked on how to monitor SNMP based systems with a low budget.
There are many commercial tools that can fulfill this request however they mostly require a lot of funding. Environments like schools or universities require a low cost solution.
A good solution would be cacti running on a linux based guest OS.
In this article I am going to explain on how to configure this in an Lab environment.

Required products
VMware Workstation (http://www.vmware.com/products/workstation/)
Linux Ubuntu v10.04.1 (http://www.ubuntu.com/server)
Cacti v0.8.7g and Plug-ins (http://www.cacti.net/)

Required steps
Step 1. Preparing VMware Workstation
Step 2. Install and Configure Ubuntu v10.04.1
Step 3. Install and Configure v0.8.7g and Plug-ins

Step 1. Preparing VMware Workstation

  • Install VMware Workstation on your computer
  • Start VMware Workstation
  • Choose create New Virtual Machine

  • Choose: Typical and click on <NEXT>

  • Choose: I will install the operating system later. and click <NEXT>

  • Choose: Linux and the appropriate version and click <NEXT>

  • Choose: Virtual Machine Name and File Location and click <NEXT>

  • Choose: 10 GB as disk size (as you prefer offcourse) and click on <NEXT>

  • Click: Customize Hardware

  • Set memory size to 1 GB

  • Set CD/DVD to use the ubuntu ISO file you downloaded

  • Choose the appropriate Network Connection

  • Click: <OK> and <FINISH>

Step 2. Install and Configure Ubuntu v10.04.1

  • Power on the virtual machine and the installation will start
  • Choose as language : English

  • Choose: Install Ubuntu Server

  • Choose Language: English – English

  • Choose your country

  • Choose your keyboard layout

  • Choose: Configure Network Manually

  • Choose an unused Ip Address that can reach the SNMP based devices you want to monitor

  • Choose the subnetmask


  • Choose the default gateway (if any)

  • Choose the DNS server

  • Choose an hostname

  • Choose the appropriate domain name

  • Choose your partitioning method

  • Select the partition

  • Write changes to disk : Yes

  • Add an user account called : administrator

  • Again add an user account called : administrator

  • Add an password for the account administrator : adminpass

  • Add the same password again for verification

  • Encrypt Home Directory : No

  • Enter a proxy account if needed

  • Choose : no automatic updates

  • To install cacti we need : Linux, Apache, Mysql and PHP (LAMP)

  • Choose a password for the mysql root user : mysqlpass

  • Add the same password again for verification

  • Install the GRUB boot loader : Yes

  • The installation is complete

 Step 3. Install and Configure v0.8.7g and Plug-ins

  • Login with administrator with password adminpass

administrator@CACTI:~$  sudo –i
root@CACTI:~# cd /
root@CACTI:/#  apt-get update
root@CACTI:/#  apt-get install php5 php5-cli php5-gd php5-mysql php5-cgi php5-snmp -y
root@CACTI:/#  apt-get install ssh -y
root@CACTI:/#  apt-get install snmp -y
root@CACTI:/#  apt-get install rrdtool –y
root@CACTI:/#  apt-get install sendmail –y
root@CACTI:/# mkdir cacti-install
root@CACTI:/# cd cacti-install
root@CACTI:/cacti-install/# wget http://www.cacti.net/downloads/cacti-0.8.7g.tar.gz
root@CACTI:/cacti-install/# tar –zxvf cacti-0.8.7g.tar.gz
root@CACTI:/cacti-install/# mv /cacti-install/cacti-0.8.7g/ /var/www/cacti
root@CACTI:/cacti-install/# groupadd cacti
root@CACTI:/cacti-install/# useradd -g cacti cactiuser
root@CACTI:/cacti-install/# chown –R cactiuser /var/www/cacti/rra
root@CACTI:/cacti-install/# chown –R cactiuser /var/www/cacti/log
root@CACTI:/cacti-install/# chmod –R 777 /var/www/cacti/log
root@CACTI:/cacti-install/# chmod –R 777 /var/www/cacti/rra
root@CACTI:/cacti-install/# mysql –u root –p

mysql> set password for root@localhost=password(‘rootpassword’);
mysql> create database cactidb;
mysql> grant all on cactidb.* to root;
mysql> grant all on cactidb.* to root@localhost;
mysql> grant all on cactidb.* to cactiuser;
mysql> grant all on cactidb.* to cactiuser@localhost;
mysql> set password for cactiuser@localhost=password(‘cactipass’);
mysql> flush privileges;
mysql> exit

root@CACTI:/cacti-install/# mysql –u root –p cactidb < /var/www/cacti/cacti.sql
root@CACTI:/cacti-install/# nano /var/www/cacti/include/config.php

$database_type = “mysql”;
$database_default = “cactidb”;
$database_hostname = “localhost”;
$database_username = “cactiuser”;
$database_password = “cactipass”;
$database_port = “3306”;

root@CACTI:/ nano /etc/crontab

*/5 * * * * cactiuser php5 /var/www/cacti/poller.php > /dev/null 2>&1

root@CACTI:/cacti-install/# wget http://www.cacti.net/downloads/spine/cacti-spine-0.8.7g.tar.gz
root@CACTI:/cacti-install/# tar –zxvf cacti-spine-0.8.7g.tar.gz
root@CACTI:/cacti-install/# mv /cacti-install/cacti-spine-0.8.7g/ /usr/local/spine
root@CACTI:/cacti-install/# cd /usr/local/spine
root@CACTI:/usr/local/spine/# apt-get install automake -y
root@CACTI:/usr/local/spine/# apt-get install autoconf -y
root@CACTI:/usr/local/spine/# apt-get install libtool -y
root@CACTI:/usr/local/spine/# apt-get install libsnmp-dev -y
root@CACTI:/usr/local/spine/# apt-get install libsnmp-base -y
root@CACTI:/usr/local/spine/# apt-get install libsnmp15 -y
root@CACTI:/usr/local/spine/# apt-get install libmysqlclient15-dev -y
root@CACTI:/usr/local/spine/# aclocal
root@CACTI:/usr/local/spine/# libtoolize –force
root@CACTI:/usr/local/spine/# autoheader
root@CACTI:/usr/local/spine/# autoconf
root@CACTI:/usr/local/spine/# automake –add-missing
root@CACTI:/usr/local/spine/# automake
root@CACTI:/usr/local/spine/# ./configure
root@CACTI:/usr/local/spine/# make
root@CACTI:/usr/local/spine/# make install
root@CACTI:/usr/local/spine/# cp /usr/local/spine/spine.conf.dist /usr/local/spine/spine.conf
root@CACTI:/usr/local/spine/# nano spine.conf

DB_Host  localhost
DB_Database  cactidb
DB_User  cactiuser
DB_Pass  cactipass
DB_Port  3306
DB_PreG 0

root@CACTI:/usr/local/spine/# cd /var/www/cacti
root@CACTI:/var/www/cacti/# wget http://www.cacti.net/downloads/patches/0.8.7g/data_source_deactivate.patch
root@CACTI:/var/www/cacti/# wget http://www.cacti.net/downloads/patches/0.8.7g/graph_list_view.patch
root@CACTI:/var/www/cacti/# wget http://www.cacti.net/downloads/patches/0.8.7g/html_output.patch
root@CACTI:/var/www/cacti/# wget http://www.cacti.net/downloads/patches/0.8.7g/ldap_group_authenication.patch
root@CACTI:/var/www/cacti/# wget http://www.cacti.net/downloads/patches/0.8.7g/script_server_command_line_parse.patch
root@CACTI:/var/www/cacti/# wget http://www.cacti.net/downloads/patches/0.8.7g/ping.patch
root@CACTI:/var/www/cacti/# wget http://www.cacti.net/downloads/patches/0.8.7g/poller_interval.patch
root@CACTI:/var/www/cacti/# patch -p1 -N < data_source_deactivate.patch
root@CACTI:/var/www/cacti/# patch -p1 -N < graph_list_view.patch
root@CACTI:/var/www/cacti/# patch -p1 -N < html_output.patch
root@CACTI:/var/www/cacti/# patch -p1 -N < ldap_group_authenication.patch
root@CACTI:/var/www/cacti/# patch -p1 -N < script_server_command_line_parse.patch
root@CACTI:/var/www/cacti/# patch -p1 -N < ping.patch
root@CACTI:/var/www/cacti/# patch -p1 -N < poller_interval.patch
root@CACTI:/var/www/cacti/# cd /usr/local/spine
root@CACTI:/usr/local/spine/# wget http://www.cacti.net/downloads/spine/patches/0.8.7g/unified_issues.patch
root@CACTI:/usr/local/spine/# patch -p1 -N < unified_issues.patch
root@CACTI:/usr/local/spine/# cd /cacti-install/
root@CACTI:/cacti-install/# wget http://mirror.cactiusers.org/downloads/plugins/cacti-plugin-0.8.7g-PA-v2.8.tar.gz
root@CACTI:/cacti-install/# tar –zxvf cacti-plugin-0.8.7g-PA-v2.8.tar.gz
root@CACTI:/cacti-install/# cp -r /cacti-install/cacti-plugin-arch/files-0.8.7g/* /var/www/cacti
root@CACTI:/cacti-install/# cd /var/www/cacti
root@CACTI:/var/www/cacti# patch -p1 -N –dry-run < /cacti-install/cacti-plugin-arch/cacti-plugin-arch.diff
root@CACTI:/var/www/cacti# patch -p1 -N < /cacti-install/cacti-plugin-arch/cacti-plugin-arch.diff
root@CACTI:/var/www/cacti# nano /var/www/cacti/include/global.php

$database_type = “mysql”;
$database_default = “cactidb”;
$database_hostname = “localhost”;
$database_username = “cactiuser”;
$database_password = “cactipass”;
$database_port = “3306”;

root@CACTI:/var/www/cacti# nano /var/www/cacti/include/config.php

$database_type = “mysql”;
$database_default = “cactidb”;
$database_hostname = “localhost”;
$database_username = “cactiuser”;
$database_password = “cactipass”;
$database_port = “3306”;
$url_path = “/cacti/”;

root@CACTI:/var/www/cacti# mysql -u root -p cactidb < /cacti-install/cacti-plugin-arch/pa.sql
root@CACTI:/var/www/cacti# cd plugins
root@CACTI:/var/www/cacti/plugins# wget http://docs.cacti.net/_media/plugin:settings-v0.7-1.tgz
root@CACTI:/var/www/cacti/plugins# mv plugin\:settings-v0.7-1.tgz settings-v0.7-1.tgz
root@CACTI:/var/www/cacti/plugins# tar –zxvf settings-v0.7-1.tgz
root@CACTI:/var/www/cacti/plugins# wget http://docs.cacti.net/_media/plugin:monitor-v1.2-1.tgz root@CACTI:/var/www/cacti/plugins# mv plugin\:monitor-v1.2-1.tgz monitor-v1.2-1.tgz
root@CACTI:/var/www/cacti/plugins# tar –zxvf monitor-v1.2-1.tgz
root@CACTI:/var/www/cacti/plugins# mysql -u root -p cactidb < /var/www/cacti/plugins/monitor/monitor.sql
root@CACTI:/var/www/cacti/plugins# wget http://docs.cacti.net/_media/plugin:discovery-v1.1-1.tgz root@CACTI:/var/www/cacti/plugins# mv plugin\:discovery-v1.1-1.tgz discovery-v1.1-1.tgz
root@CACTI:/var/www/cacti/plugins# tar –zxvf discovery-v1.1-1.tgz
root@CACTI:/var/www/cacti/plugins# mysql -u root -p cactidb < /var/www/cacti/plugins/discovery/discover.sql
root@CACTI:/var/www/cacti/plugins# wget http://docs.cacti.net/_media/plugin:mactrack-v2.9-1.tgz root@CACTI:/var/www/cacti/plugins# mv plugin\:mactrack-v2.9-1.tgz mactrack-v2.9-1.tgz
root@CACTI:/var/www/cacti/plugins# tar –zxvf mactrack-v2.9-1.tgz
root@CACTI:/var/www/cacti/plugins# mysql -u root -p cactidb < /var/www/cacti/plugins/mactrack/mactrack.sql
root@CACTI:/var/www/cacti/plugins# wget http://docs.cacti.net/_media/plugin:spikekill-v1.2-1.tgz root@CACTI:/var/www/cacti/plugins# mv plugin\:spikekill-v1.2-1.tgz spikekill-v1.2-1.tgz
root@CACTI:/var/www/cacti/plugins# tar –zxvf spikekill-v1.2-1.tgz

  • Choose <NEXT>

  • Choose <FINISH>

  • Enter username : admin and password : admin and click <Login>

  • Add a new password to your liking and click <Save>

  • Choose settings

  • Choose path and enter the spine poller path and click on <Save>

  • Choose Poller and change the poller to spine and click on <Save>

  • Choose user management and click on admin

  • Enable plugin management en click op <Save>

  • Choose plugin management en install & enable all plugins

  • Now you are ready to add devices and monitor your SNMP based devices.

This concludes my article about installing and configuring cacti v0.8.7g on Ubuntu v10.04.1. I hope you found this article usefull and feel free to comment.

  1. Prabodha (ja$on)
    October 1, 2011 at 8:07 pm

    Thanks bro. Great job.

  2. Abiud
    October 16, 2011 at 9:29 pm

    Gracias, me ha servido como referencia para actualizar mi cacti intengrando plugins.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: