Install Cacti Version 0.8.7g on Centos 6.
5 with Cisco WLC - 5508,
Architecture 0.8.7g-PA-v2.8, cacti-spine-0.8.7g, rrdtool-1.4.5, pluginmonitor, plugin-settings and plugin-tholds.
CentOS - Installing Apache and PHP5
CentOS comes with Apache v.2.2.3 and PHP v.5.1.6 and they are easily installed via the default CentOS
Package Manager, yum.
The advantage of using yum (as opposed to installing via source code) is that you will get any security
updates (if and when distributed) and dependencies are automatically taken care of.
Apache Install
A basic Apache install is very easy:
# yum -y install httpd mod_ssl
Oddly, the server does not start automatically when you install it so you have to do this by hand:
# /usr/sbin/apachectl start
The first thing you will see is this error:
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name,
# using 127.0.0.1 for ServerName
As you can see, the address 127.0.0.1 (or whatever address you see there, usually your main IP address)
is used as the server name by default. It's a good idea to set the ServerName for the next time the server
is started.
Open the main Apache config:
# nano /etc/httpd/conf/httpd.conf
Towards the end of the file you'll find a section that starts with ServerName and gives the example:
#ServerName www.example.com:80
All you need to do is enter your Cloud Server host name or a fully-qualified domain name:
SeerverName cacti3.uprm.edu
Note that my Cloud Server host name is cacti3.uprm.edu.
Now just reload Apache:
# /usr/sbin/apachectl restart
And the warning has gone.
Disable Firewall
HowTo Disable The Iptables Firewall in Linux
Task: Disable / Turn off Linux Firewall (Red hat/CentOS/Fedora Core)
Type the following two commands (you must login as the root user):
# /etc/init.d/iptables save
# /etc/init.d/iptables stop
Turn off firewall on boot:
# chkconfig iptables off
Default Page
If you navigate to your Cloud Server IP address:
http://123.45.67.89
You will see the default CentOS Apache welcome screen.
Chkconfig
Now that we have Apache installed and working properly, we need to make sure that it's set to start
automatically when the Cloud Server is rebooted.
# /sbin/chkconfig httpd on
Let's check our work to confirm:
# /sbin/chkconfig --list httpd
httpd
0:off
The setting works.
1:off 2:on 3:on 4:on 5:on 6:off
PHP5 Install
Let's move on to the PHP5 install. I'm not going to install all the modules available, just a few common
ones so you get the idea.
As before, due to using yum to install PHP5, any dependencies are taken care of:
# yum -y install php-mysql php-devel php-gd php-pecl-memcache php-pspell php-snmp php-xmlrpc phpxml php
Once done, reload Apache:
# /usr/sbin/apachectl restart
RRDtool install
# yum groupinstall "Development tools"
# yum -y install cairo-devel pango-devel libxml2-devel
#wget "http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.4.8.tar.gz"
# cp rrdtool-1.4.8.tar.gz /usr/local/
#cd /usr/local
# tar zxf rrdtool-1.4.8.tar.gz
# cd ./rrdtool-1.4.8/
# ./configure --prefix=/usr/local/rrdtool-1.4.8
# make
# make install
# ln -s /usr/local/rrdtool-1.4.8 /usr/local/rrdtool
# echo '/usr/local/rrdtool/lib' > /etc/ld.so.conf.d/rrdtool.conf
# /sbin/ldconfig
SNMP install
# yum -y install net-snmp net-snmp-utils
# cd /etc/snmp
# cp snmpd.conf snmpd.conf.original
Replace snmpd.comf with the following information:
# nano snmpd.conf
syslocation Monzon-001
syscontact Martin Melendez
[email protected]disk / 10000
disk /var 10000
load 12 14 14
rocommunity rumnet2000
Restart apache server
# /etc/init.d/snmpd restart
Test snmp
# snmpwalk -v1 -c rumnet2000 cacti.uprm.edu
Cacti Install
# yum -y install mysql mysql-server
# chkconfig --levels 235 mysqld on
# /etc/init.d/mysqld start
# mysql_secure_installation
Create the database for cacti
# mysqladmin -u root -p create cacti
# mysql -u root -p mysql
Note: Password will be replaced with your cacti password
# mysql> GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'ASSIGN A PASSWORD';
#mysql> GRANT ALL PRIVILEGES ON *.* TO 'cactiuser'@'%' WITH GRANT OPTION;
#mysql> grant all privileges on cacti.* to cactiuser@localhost identified by 'krakat0a';
# mysql> flush privileges;
# mysql> exit
Install CACTI
#cd /
# cd /usr/local
# wget http://www.cacti.net/downloads/cacti-0.8.7g.tar.gz
# tar zxf cacti-0.8.7g.tar.gz
# chown -R root:root /usr/local/cacti-0.8.7g
# ln -s /usr/local/cacti-0.8.7g /usr/local/cacti
# cd ./cacti/
# mysql -u cactiuser -p cacti < cacti.sql
# cd /usr/local/cacti/include/
Verify and modify file config.php
Note: Password will be replaced with your cacti password
# nano config.php
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "PASSWORD";
$database_port = "3306";
# chown apache config.php
# chmod 600 config.php
#cd /
# cd /usr/local/cacti
# chown apache rra
# echo -e '*/5 * * * * apache /usr/bin/php /usr/local/cacti/poller.php >/dev/null 2>&1'
>/etc/cron.d/cacti
# cd /etc/httpd/conf.d/
Add the following text in new file cacti.conf
# nano cacti.conf
Alias /cacti /usr/local/cacti
<Directory /cacti>
Order deny,allow
Deny from all
Allow from 127.0.0.1
Allow from 136.145.33.0/24
</Directory>
RewriteEngine on
RewriteRule ^/cacti/(.*) https://%{HTTP_HOST}/cacti/$1 [R,L]
# /sbin/service httpd graceful
GUI CONFIGURATION FOR CACTI
Go to https://yourserver/cacti/
Answer NEXT and verify the path list of cacti. Correct path if necessary.
Go to Console > Configuration > Settings > General > Event Logging > Log File Destination:
Syslog/Eventlog Only > save
Console > Configuration > Settings > General > Required Tool Versions > RRDTool Utility Version:
RRDTool 1.4.x > save
Cisco WLC - 5508 install
# cd /
#cd /usr/local
Download cacti_host_template_cisco_wlc_-_5508_revised http://forums.cacti.net/download/file.php?id=24599
Copy WLC-5508.zip file to your cacti server /usr/local/
Create WLC directory in /usr/local/
# mkdir WLC
# cp WLC-5508.zip /usr/local/WLC
# cd WLC
# unzip WLC-5508.zip
# cp cisco-wlc-wlanassoc.xml /usr/local/cacti-0.8.7g/resource/snmp_queries/
# cp cisco_wlc_interfaces_assoc.xml /usr/local/cacti-0.8.7g/resource/script_queries/
# cp cisco_wlc_aps_assoc.xml /usr/local/cacti-0.8.7g/resource/script_queries/
# cp Cisco_WLC_Radios.xml /usr/local/cacti-0.8.7g/resource/script_server/
# cp *.php /usr/local/cacti-0.8.7g/scripts
Import the host template cacti_host_template_cisco_wlc_-_5508_revised.xml with the Cacti
GUI
Note: Proceed to create WLC device and verify its acquire data.
Spine Install
# cd /
# yum -y install net-snmp-devel mysql-devel openssl-devel
# cd /usr/local/
# wget "http://www.cacti.net/downloads/spine/cacti-spine-0.8.7g.tar.gz"
# tar zxf cacti-spine-0.8.7g.tar.gz
# cd cacti-spine-0.8.7g
# ./configure --prefix=/usr/local/cacti-spine-0.8.7g
# make
# make install
Create a shortcut or logical line to the following folders
# ln -s /usr/local/cacti-spine-0.8.7g /usr/local/cacti-spine
# cp -a /usr/local/cacti-spine/etc/spine.conf.dist /usr/local/cacti-spine/etc/spine.conf
# cd /usr/local/cacti-spine/etc/
# nano spine.conf
Verify that spine.conf the following text
DB_Host
localhost
DB_Database
cacti
DB_User
cactiuser
DB_Pass
krakat0a
DB_Port
3306
DB_PreG
# chown apache /usr/local/cacti-spine/etc/spine.conf
# chmod 600 /usr/local/cacti-spine/etc/spine.conf
GUI
Go to Console > Configuration > Settings > Paths > Alternate Poller Path > Spine Poller File Path:
/usr/local/cacti-spine-0.8.7g/bin/spine > save
Console > Configuration > Settings > Poller > General > Poller Type: spine > save
Architecture install
#cd /
# cd /usr/local/
# wget http://www.cacti.net/downloads/pia/cacti-plugin-0.8.7g-PA-v2.8.tar.gz
# tar -zvxf cacti-plugin-0.8.7g-PA-v2.8.tar.gz
****Important NOTE: Backup your cacti directory********
# cd cacti-plugin-arch
# cd files-0.8.7g
# cp -Rf * /usr/local/cacti/
# nano /usr/local/cacti-0.8.7g/include/config.php
Edit config.php and verify if the database type, name, host, user and password for your Cacti
configuration. The $plugins array is required for using the Plugin Architecture (PIA) only. Add the
following line to the config.php file:
/* load up old style plugins here */
$plugins = array();
/*
Edit this to point to the default URL of your Cacti install
ex: if your cacti install as at http://serverip/cacti/ this
would be set to /cacti/
*/
$url_path = "/cacti/";
The plugin architecture includes a pa.sql file. You will need to import this into your cacti SQL database.
# cd /usr/local/cacti-plugin-arch/
# mysql -u cactiuser -p cacti < pa.sql
GUI
Go to Console, Utilities, User Management, select user. Under Real Permissions select Plugin
Management.
New files from cacti for monitor, setting and tholds:
http://docs.cacti.net/_media/plugin:monitor-v1.3-1.tgz
http://docs.cacti.net/_media/plugin:settings-v0.71-1.tgz
http://docs.cacti.net/_media/plugin:thold-v0.5.0.tgz
Monitor, Thold, Settings plugins install
#cd /usr/local/
#wget http://docs.cacti.net/_media/plugin:monitor-v1.2-1.tgz
#wget http://docs.cacti.net/_media/plugin:settings-v0.7-1.tgz
#wget http://docs.cacti.net/_media/plugin:thold-v0.5.0.tgz
#wget http://docs.cacti.net/_media/plugin:mactrack-v2.9-1.tgz
Rename the following files:
# mv plugin:monitor-v1.2-1.tgz plugin-monitor-v1.2-1.tgz
# mv plugin:settings-v0.7-1.tgz plugin-settings-v0.7-1.tgz
# mv plugin:thold-v0.5.0.tgz plugin-thold-v0.5.0.tgz
mv plugin:mactrack-v2.9-1.tgz plugin-mactrack-v2.9-1.tgz
Decompress the following files:
# tar zxvf plugin-monitor-v1.2-1.tgz
# tar zxvf plugin-settings-v0.7-1.tgz
# tar zxvf plugin-thold-v0.5.0.tgz
# tar zxvf plugin-mactrack-v2.9-1.tgz
Copy the following files or folders content on:
# cp -R monitor /usr/local/cacti/plugins
# cp -R settings /usr/local/cacti/plugins
# cp R thold /usr/local/cacti/plugins
cp -R mactrack /usr/local/cacti/plugins
Modify the following file:
# cd /usr/local/cacti/include/
# nano config.php
Add the following text to the file
$plugins[] = 'monitor';
$plugins[] = 'settings';
$plugins[] = 'thold';
$plugins[] = 'mactrack';
Install FONTS for graphs
# yum -y install deja*
Activate the plugins on cacti:
Go to Console, User Management , check Plugins permissions
Go to Console, Plugin Management , enable all the plugins
rrdtool
References:
http://www.rackspace.com/knowledge_center/article/centos-apache-and-php-install
http://www.cyberciti.biz/faq/turn-on-turn-off-firewall-in-linux/
http://forums.cacti.net/viewtopic.php?f=12&t=43852
http://pooh.gr.jp/?p=9492
http://www.adminsehow.com/2010/11/install-snmp-on-centosrhel/
http://docs.cacti.net/manual:087:1_installation.9_pia