How to install Cacti on CentOS 5

Cacti is an open source RRDtool-based graphing system that uses PHP/Apache for its interface and stores configuration data in a MySQL database. It scales well and may be used within large enterprise network environments. It also supports a robust plugin architecture that allows powerful Cacti plugins, such as Network Weathermap.

 

Install SNMP :

[shell]

# yum install net-snmp net-snmp-utils

[/shell]

 

Install Cacti

[shell]

# yum install cacti

[/shell]

 

Configure snmpd, move snmpd.conf and create a new one. The ‘snmpuser’ is what you’ll use later in the Cacti interface

[shell]

# mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.old
# echo "rocommunity snmpuser" > /etc/snmp/snmpd.conf

[/shell]

 

Create ‘cacti’ MySQL database and grant privileges to ‘cactiuser’ with password ‘cactipassword’

[shell]

# msql

[/shell]

[text]
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 14323
Server version: 5.0.77 Source distribution

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

[/text]

[shell]

mysql>create database cacti;
mysql>GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'cactipassword';
mysql>quit

[/shell]

 

Import the Cacti database schema

[shell]

# mysql -ucactiuser -pcactipassword cacti < /var/www/cacti/cacti.sql

[/shell]

 

Configure Cacti with the details above.

[shell]

# vi /var/www/cacti/include/config.php

[/shell]

[text]

/* make sure these values refect your actual database/host/user/password */

$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "cactipassword";
$database_port = "3306";

[/text]

Comments