Install Cacti On CentOS

Standard



Assume you have this package

- Apache
- MySQL
- PHP

Install Required Packages
1. Install php addon
yum install php-mysql php-pear php-common php-gd php-devel php php-mbstring php-cli php-mysql php-snmp -y

2. Install net-snmp
yum install net-snmp-utils net-snmp-libs php-pear-Net-SMTP -y

3. Install rrdtool
yum install rrdtool -y

Start SNMP Service
service snmpd start
chkconfig snmpd on

Create Database for cacti
1. Login to mysql
mysql -u root -p
Enter password : xxxxx
2. Create Database
mysql > create database cacti;
3. Create User (chage username and password to your info)
mysql > grant all on cacti.* to username@localhost identified by 'password'
4. Reload Grant Table
mysql > flush privileges;

Check or edit php.ini
date.timezone = your timezone
--- Example ----
date.timezone = Asia/Bangkok    // Thailand

Install CACTI
1. Download cacti from http://www.cacti.net
2. Unzip and upload file to   /var/www/html/cacti
3. Restore cacti database (chage mysql user and password to your info)
# mysql -u mysqluser -p cacti < cacti.sql
# Enter Password : mysqlpassword
4. Edit config file   "include/concifg.php"
   $database_username="mysqluser";
   $database_password="mysqlpassword";
5. Call cacti url =>  http://your ip/cacti
    -  Cacti Installation Guide Page 1  => Click Next
    -  Cacti Installation Guide Page 2  => Select New Install and Click Next
    -  Cacti Installation Guide Page 3  => Click Next
    -  Cacti Installation Guide Page 4  Login with defual Username and Password (admn , admin)
    -  Cacti Installation Guide Page 5  Change admin password

Create Contrab
1. vi /etc/cron.d/cacti
2. Add this command
*/5 * * * * root /usr/bin/php /var/www/html/cacti/poller.php > /dev/null 2>&1