Cacti Network Management Installation Tutorial
Network management has to be, one of the most neglected pieces of networking. I am sure we all have our hypotheses as to why but that is for another day. This tutorial is for installing the latest stable release 0.8.8a, released on 04/29/12. I needed to proof Cacti and get a scripted installation together. Cacti has been around a long time and has a nice ecosystem of plugins. Like any open source there is much more code then documentation. That said, the Cacti community forum is fantastic and full of community contributions. I tested the installation on both current CentOS and RHEL. It could be easily ported to Ubuntu s/yum/apt-get/g.
Cacti Network Management Plugins
Here are some supported and user built plugins part of this install.
- Discovery – Auto Host Discovery
- Mactrack – End Device Port Tracker and General Network Toolkit
- Monitor – Monitoring for Cacti
- Realtime – Realtime Graph Viewer
- Routerconfigs – Router Config Backup
- Syslog – Sylog Viewer for Cacti
- Weathermap – Generate maps and diagrams using data collected by Cacti or other sources
Examples of Cacti
A couple of my friends in have some public examples of similar Cacti network management deployments using the Weathermap plugin for Cacti.
- A GigaPop in Illinois from Nick Buraglio found here.
- Here is another one from Bob Plankers found here.
Cacti Installation ScreenCast
Cacti Network Management Installation Script
I started writing my own script from the doc and realized I needed better documentation. Poking around on the forum I found a nice script that had already done most of the work on the forums. I modified it for the latest releases, modified a couple of PHP configs and updated a couple of plugins.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
#!/bin/sh # Testing script for install cacti 0.8.7i and spine 0.8.7i on Centos Linux Release 6.x # Version : 1.0.4 # Make by Patrick.Ru @ China # E-Mail : patrick.ru@hotmail.com # Date : 28-Dec-2011 # Thanks to Patrick Ru of China for posting this script. # I modified the script add the latest version 0.8.8a, released 04/29/12. # Along with updating a couple plugins and # changing the php config at the end s//g -Brent Salisbury chkconfig iptables off service iptables stop sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config /usr/sbin/setenforce 0 yum update -y yum install -y wget mkdir -p /usr/src/cacti cd /usr/src/cacti yum install -y httpd chkconfig httpd on service httpd start yum install -y mysql-server chkconfig mysqld on service mysqld start mysqladmin -u root password dbadmin yum install -y php php-gd php-mysql php-cli php-ldap php-snmp php-mbstring php-mcrypt service httpd restart yum install -y rrdtool yum install -y net-snmp-utils yum install -y tftp-server chkconfig xinetd on service xinetd start wget http://www.cacti.net/downloads/cacti-0.8.7i-PIA-3.1.tar.gz tar zxvf cacti-0.8.7i-PIA-3.1.tar.gz wget http://www.cacti.net/downloads/patches/0.8.7i/settings_checkbox.patch cd cacti-0.8.7i-PIA-3.1 yum install -y patch patch -p1 -N < ../settings_checkbox.patch cd .. mv -f cacti-0.8.7i-PIA-3.1/* /var/www/html/ rm -rf cacti-0.8.7i-PIA-3.1 chown -R apache:apache /var/www/html/ service httpd restart mysql -u root -pdbadmin -e 'CREATE DATABASE `cacti` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;' mysql -u root -pdbadmin -e "CREATE USER 'cactiuser'@'localhost' IDENTIFIED BY 'cactiuser';" mysql -u root -pdbadmin -e 'GRANT ALL PRIVILEGES ON `cacti` . * TO 'cactiuser'@'localhost';' mysql -u cactiuser -pcactiuser cacti < /var/www/html/cacti.sql cat > /etc/cron.d/cacti <<EOF */5 * * * * apache /usr/bin/php /var/www/html/poller.php > /dev/null 2>&1 EOF yum install -y gcc gcc-c++ make automake patch libtool net-snmp-devel openssl-devel mysql mysql-devel wget http://www.cacti.net/downloads/spine/cacti-spine-0.8.7i.tar.gz tar zxvf cacti-spine-0.8.7i.tar.gz cd cacti-spine-0.8.7i ./configure make && make install cp /usr/local/spine/etc/spine.conf.dist /usr/local/spine/etc/spine.conf cd /usr/src/cacti wget http://docs.cacti.net/_media/plugin:settings-v0.71-1.tgz -O settings.tgz tar zxvf settings*.tgz -C /var/www/html/plugins chown -R apache:apache /var/www/html/plugins/settings wget http://docs.cacti.net/_media/plugin:clog-v1.7-1.tgz -O clog.tgz tar zxvf clog*.tgz -C /var/www/html/plugins chown -R apache:apache /var/www/html/plugins/clog wget http://docs.cacti.net/_media/plugin:thold-v0.4.9-3.tgz -O thold.tgz tar zxvf thold*.tgz -C /var/www/html/plugins chown -R apache:apache /var/www/html/plugins/thold wget http://docs.cacti.net/_media/plugin:monitor-v1.3-1.tgz -O monitor.tgz tar zxvf monitor*.tgz -C /var/www/html/plugins chown -R apache:apache /var/www/html/plugins/monitor wget http://docs.cacti.net/_media/plugin:realtime-v0.5-1.tgz -O realtime.tgz tar zxvf realtime*.tgz -C /var/www/html/plugins mkdir -p /var/www/html/plugins/realtime/cache chown -R apache:apache /var/www/html/plugins/realtime yum install -y unzip wget http://www.network-weathermap.com/files/php-weathermap-0.97a.zip unzip php-weathermap-0.97a.zip -d /var/www/html/plugins/ chown -R apache:apache /var/www/html/plugins/weathermap wget http://docs.cacti.net/_media/plugin:mactrack-v2.9-1.tgz -O mactrack.tgz tar zxvf mactrack*.tgz -C /var/www/html/plugins chown -R apache:apache /var/www/html/plugins/mactrack wget http://docs.cacti.net/_media/plugin:syslog-v1.22-2.tgz -O syslog.tgz tar zxvf syslog*.tgz -C /var/www/html/plugins chown -R apache:apache /var/www/html/plugins/syslog wget http://docs.cacti.net/_media/plugin:routerconfigs-v0.3-1.tgz -O routerconfigs.tgz tar zxvf routerconfigs*.tgz -C /var/www/html/plugins mkdir -p /var/www/html/plugins/routerconfigs/backups chown -R apache:apache /var/www/html/plugins/routerconfigs wget http://docs.cacti.net/_media/plugin:docs-v0.4-1.tgz -O docs.tgz tar zxvf docs*.tgz -C /var/www/html/plugins mv -f /var/www/html/plugins/docs* /var/www/html/plugins/docs chown -R apache:apache /var/www/html/plugins/docs wget http://nchc.dl.sourceforge.net/project/cacti-reportit/cacti-reportit/reportit_v073/reportit_v073.tar.gz -O reportit.tar.gz tar zxvf reportit*.tar.gz -C /var/www/html/plugins chown -R apache:apache /var/www/html/plugins/reportit wget http://docs.cacti.net/_media/plugin:rrdclean-v0.41.tgz -O rrdclean.tgz tar zxvf rrdclean*.tgz -C /var/www/html/plugins chown -R apache:apache /var/www/html/plugins/rrdclean wget http://docs.cacti.net/_media/plugin:discovery-v1.5-1.tgz -O discovery.tgz tar zxvf discovery*.tgz -C /var/www/html/plugins chown -R apache:apache /var/www/html/plugins/discovery if [ "$HOSTTYPE" == "x86_64" ]; then wget http://www6.atomicorp.com/channels/atomic/centos/6/x86_64/RPMS/wmi-1.3.14-2.el6.art.x86_64.rpm rpm -Uvh wmi-1.3.14-2.el6.art.x86_64.rpm elif [ "$HOSTTYPE" == "i386" ]; then wget http://www6.atomicorp.com/channels/atomic/centos/6/i386/RPMS/wmi-1.3.14-2.el6.art.i686.rpm rpm -Uvh wmi-1.3.14-2.el6.art.i686.rpm fi wget http://svn.parkingdenied.com/CactiWMI/trunk/wmi.php -O /var/www/html/scripts/wmi.php chown -R apache:apache /var/www/html/scripts/wmi.php service httpd restart |
The Cisco Catalyst 6500 template I used for the screencast can be downloaded here. Simply copy and paste it into the templates section and then associate it to the 6500 you populate. Check the forums for more templates.
Post Installation and Plugins
If you have issues with RHEL you may need to run the following.
1 2 3 |
php -q /var/www/html/cli/rebuild_poller_cache.php |
Enable plugins under settings -> Management as shown in the following screen capture. Just click the blue down arrow to add it into the console as tab.
So checkout the forums if interested and see if any of the project can help your operations, maybe even contribute what you do back.
Thanks for stopping by.
A few additional “must have” plugins (for larger deployments): boost, dsstats, and autom8!
Thanks will add that in! Have you used the netflow module before?
This is amazing. I’d done this years ago and promptly forgotten all the pieces and parts. After 30 minutes of tinkering and this script, I have a complete graphing setup for a project I was working on. Thanks.
Thanks Nick! And thanks for showing me the nice build your shop has.
The netflow plugin in cacti is a front-end for flowtools collector, which is kind of old school now days (but still useful). Flowtools doesn’t have a GUI, so the Cacti plugin provides that… Nfsen is another open source collector that comes with its own WebUI. Neither are pretty but get the job done in a pinch 🙂
Similarly the Routerconfigs plugin is a front-end for accessing data in RANCID, and alternatively RANCID configs can be viewed and diffed using ViewVC.
Check out Silk as another possibility
Another thing, flowtools only supported netflow. Nfsen supports netflow and sflow. To use sflow with flowtools, flows have to be converted.
Flowtools also only supports v5 netflow.
The ability to do tagging and create filters made netflow a great tool. Flow Viewer is a great frontend for flowtools.
Thanks Shox. Appreciate the info. Great stuff. Will add it in and important insight for us.
Mate. Super post. There are some solid custom builds around that are compiled. I am currently investigating http://cactiez.cactiusers.org/ – It is built with a raft of popular plugins and scripted deployment.
Great post Brent.
Now thats cool! thanks bro.
,how about the installation of CactiWMI in cacti Version 0.8.8a in CentOS,
anyone here knows how to install the WMI???
plsss,,help me 🙁
Hi Brent,
Nice article, but I think the title doesn’t meet with cacti, as far I know cacti isn’t a network management it’s only network monitoring system.
cheers 🙂
True, but monitoring and trending are all part of management. There have been a lot of plugins developed that push it beyond its’ basics.
It’s all only eye candy without a good understanding of SNMP and mibs. But, I see less control put into manufacturers mibs than previous and just legacy standard counters which is odd since there is now some security with v3 instead of obscurity of v1 & v2c