I’ve been wanting to try the Cacti network graphing system for a while, but wasn’t sure how much effort it would take. Well, it wasn’t too bad, and here are the steps that I used. Hopefully this will save someone else a few minutes.I started with the CentOS 4.3 Server CD. I really like having a single CD that will install what’s necessary for a server. I use the .iso and VMWare Server, and can have a server installed from scratch in very little time. For this server, I chose to customize the list of packages. I unchecked Mail Server, Windows File Server, DNS Name Server, FTP Server, and Printing Support. I added System Tools. I’ll assume that you have your OS installed at this point.
Configure yum. Since I want to use yum as much as possible, and cacti is not in the default CentOS repositories, I added Dag to my list of repositories. This is as simple as creating the file /etc/yum.repos.d/Dag.repo and putting the following in it:
name=Dag RPM Repository for Red Hat Enterprise Linux
That last option (“protect=0”) only does anything if you’ve installed the ProtectBase plugin for yum. This plugin keeps yum from updating system or base packages from non-CentOS repositories (or however you want to configure it). You can read about it here.
Install prerequisites. Now we need to install the packages that Cacti depends on, and the Cacti package itself. Use yum, and allow it to install any dependencies for the following packages. Just running “yum install cacti” might have caught all of these too, but I didn’t try that.
shell# yum install net-snmp
shell# yum install mysql
shell# yum install mysql-server
shell# yum install cacti
Configure Apache. By default, the cacti.conf file in /etc/httpd/conf.d is set to deny access to everyone. I made a copy of the file for safekeeping and then edited cacti.conf to remove the line “deny from all”.
Start services. Now we need to start some services and set them to start whenever the machine starts up:
shell# service mysqld start
shell# service httpd start
shell# chkconfig –level 345 mysqld on
shell# chkconfig –level 345 httpd on
Configure mysql. Now your server is actually serving up Cacti documentation from http://servername/cacti/docs/html/index.html. These last steps are from the Installing under Unix page at http://servername/cacti/docs/html/install_unix.html.
shell# mysqladmin –user=root create cacti
shell# cd /var/www/cacti
shell# mysql cacti < cacti.sql shell# mysql --user=root mysql mysql> GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY ‘cactiuser’;
mysql> flush privileges;
Schedule the poller. Add a line like the following to /etc/crontab to schedule the poller:
*/5 * * * * cacti php /var/www/cacti/poller.php > /dev/null 2>&1
Complete the installation. Browse to http://servername/cacti/index.php and follow the instructions to complete the installation. You should just need to click Next>, Next>, Finish.
Login and begin to use Cacti. Login as admin, password admin, and change the password as required. Now you’re ready to start using Cacti! After I gain some experience, I may post some tips.