Before I begin though, I must admit that I cannot take all of the credit for this "How To". I've only added small bits and pieces to a great "How To" I found on the internet, but can no longer find the original source unfortunately.
Please Note: I am not a Linux nor a Cacti expert, so if there are any unnecessary steps/installations, please let me know so that I can edit this How To accordingly. For example, I don't know if all of the packages listed below are required... I've basically put them together from several guides based on several different versions of Cacti and RRDTool.
Also Note: This is on a clean install which is why packages like gcc and nano are in the package install list.
Anyway, here goes
***************************************************
Step One:
***************************************************
Install packages for Cacti & RRDTool:
Code: Select all
yum install -y mysql mysql-server httpd mod_ssl php php-snmp php-mysql net-snmp net-snmp-utils nano cairo-devel libxml2-devel pango-devel pango libpng-devel freetype freetype-devel libart_lgpl-devel gcc
yum update
Step Two:
***************************************************
Download Cacti & move it to your web server directory:
Code: Select all
cd /tmp
wget http://www.cacti.net/downloads/cacti-0.8.8.tar.gz
tar zxvf cacti-0.8.8.tar.gz
mv /tmp/cacti-0.8.8 /var/www/html/cacti
Step Three:
***************************************************
Reconfigure include/config.php path. Change it from / to /cacti/.
Note: Be sure to uncomment this line too by removing the //, as per the before and after example below.
Code: Select all
nano /var/www/html/cacti/include/config.php
Code: Select all
//$url_path = "/";
Code: Select all
$url_path = "/cacti/";
***************************************************
Step Four:
***************************************************
Add a new user and then change the ownership and permissions of the rra and log directories.
Code: Select all
adduser cactiuser
chown -R cactiuser /var/www/html/cacti/rra
chown -R cactiuser /var/www/html/cacti/log
chmod 777 -R /var/www/html/cacti/rra
chmod 777 -R /var/www/html/cacti/log
Step Four:
***************************************************
Download and install RRDTool.
Code: Select all
cd /tmp
wget http://oss.oetiker.ch/rrdtool/pub/rrdtool.tar.gz
tar zxvf rrdtool.tar.gz
cd rrdtool-1.4.7
./configure
make prefix=/usr/local/ all
make prefix=/usr/local/ install
Step Five:
***************************************************
Start MySQL, Sendmail, snmpd and Apache, and make sure they start on boot:
Code: Select all
chkconfig httpd on --levels 235
chkconfig mysqld on --levels 235
chkconfig sendmail on --levels 235
chkconfig snmpd on --levels 235
service mysqld start
service httpd start
service sendmail start
service snmpd start
Step Six:
***************************************************
Configuring MySQL
Code: Select all
/usr/bin/mysql_secure_installation
Code: Select all
current root password is <LEAVE BLANK>
set root password to: <ENTER PASSWORD>
remove anonymous users <YES>
disallow remote root login <YES>
remove test database <YES>
reload privilege tables <YES>
Step Seven:
***************************************************
Create the Cacti Database:
Code: Select all
mysqladmin -u root -p create cacti
mysql -p cacti < /var/www/html/cacti/cacti.sql
mysql -u root -p mysql
GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'cactiuser';
flush privileges;
exit
Step Eight:
***************************************************
Set up Cacti via the web interface:
Code: Select all
http://<ip_address>/cacti
***************************************************
Step Nine:
***************************************************
Add a cron job to make the Cacti poll every 5 minutes. Note: The username used here must be the same as the one created in Step 4.
Code: Select all
nano /etc/crontab
*/5 * * * * cactiuser php /var/www/html/cacti/poller.php > /dev/null 2>&1
Step Ten:
***************************************************
If your "Localhost" is staying in the "Unknown" state and is not transitioning to the "Up" state, turn on SNMPv1 in its "Device Configuration" and change its "Downed Device Detection" to "SNMP Uptime".
***************************************************
Step Eleven:
***************************************************
Due to a bug in 8.8 (which will be resolved in 8.8a), users cannot import templates (see http://forums.cacti.net/viewtopic.php?f=2&t=47018 for more information). To resolve this issue, download global_arrays.php from the SVN here and put it in your <cacti_dir>/include/ directory.
***************************************************
All Done!
***************************************************
And now your done!
As mentioned above, if there are any unnecessary packages or if you have any suggestions, please let me know and I'll be happy to make the corrections.