You need to install the following software on RHEL / Fedora / CentOS Linux:
- MySQL Server : Store cacti data.
- NET-SNMP server - SNMP (Simple Network Management Protocol) is a protocol used for network management.
- PHP with net-snmp module - Access SNMP data using PHP.
- Apache / lighttpd / ngnix webserver : Web server to display graphs created with PHP and RRDTOOL.
Install the software
First, login as root user and type the following command to install mysql, apache and php:
# yum install mysql-server mysql php-mysql php-pear php-common php-gd php-devel php php-mbstring php-cli php-snmp php-pear-Net-SMTP php-mysql httpd
Configure MySQL server
First, set root password:
# mysqladmin -u root password mysql%55
Create cacti MySQL database
Create a database called cacti, enter:
# mysql -u root -p -e 'create database cacti'
Create a user called cacti with a password called cacti%55, enter:
# mysql -u root -p
mysql> GRANT ALL ON cacti.* TO cacti@localhost IDENTIFIED BY 'cacti%55';
mysql> FLUSH privileges;
mysql> \q
Install snmpd
Type the following command to install net-snmpd
# yum install net-snmp-utils php-snmp net-snmp-libs
Configure snmpd, open /etc/snmp/snmpd.conf
# vi /etc/snmp/snmpd.conf
Append / modify it as follows (see snmpd.conf man page for details):
com2sec local localhost public
group MyRWGroup v1 local
group MyRWGroup v2c local
group MyRWGroup usm local
view all included .1 80
access MyRWGroup "" any noauth exact all all none
syslocation Unknown (edit /etc/snmp/snmpd.conf)
syscontact Root (configure /etc/snmp/snmp.local.conf)
pass .1.3.6.1.4.1.4413.4.1 /usr/bin/ucd5820stat
Save and close the file. Turn on snmpd service:
# /etc/init.d/snmpd start
# chkconfig snmpd on
Make sure you are getting information from snmpd:
# snmpwalk -v 1 -c public localhost IP-MIB::ipAdEntIfIndex
Sample ouptut:
IP-MIB::ipAdEntIfIndex.10.10.29.68 = INTEGER: 2
IP-MIB::ipAdEntIfIndex.67.yy.zz.eee = INTEGER: 3
IP-MIB::ipAdEntIfIndex.127.0.0.1 = INTEGER: 1
Install Cacti
# groupadd cacti
# useradd -g cacti cacti
# passwd cacti
Changing password for user cactiuser.
New UNIX password: cacti%55
Retype new UNIX password: cacti%55
passwd: all authentication tokens updated successfully.
# useradd -g cacti cacti
# passwd cacti
Changing password for user cactiuser.
New UNIX password: cacti%55
Retype new UNIX password: cacti%55
passwd: all authentication tokens updated successfully.
# wget http://www.cacti.net/downloads/cacti-0.8.7b.tar.gz
# tar xzvf cacti-0.8.7b.tar.gz -C /var/www/html/
# cd /var/www/html/
# mv cacti-0.8.7b cacti
# cd cacti/
# mysql -u root -p cacti < cacti.sql
# vi include/config.php
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cacti";
$database_password = "cacti%55";
$database_port = "3306";
# chown -R cactiuser rra/ log/
# crontab -e
*/5 * * * * /usr/bin/php /var/www/html/cacti/poller.php
Install RRDTool
Install required dependencies
Login as root and type the following command:
# yum install cairo-devel libxml2-devel pango-devel pango libpng-devel freetype freetype-devel libart_lgpl-devel
Step # 2: Download latest rrdtool tar ball
Type the following commands:
# cd /opt/
# wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.4.5.tar.gz
Untar tar ball, enter:
# tar -zxvf rrdtool-1.3.1.tar.gz
Compile and install rrdtool
You need to set PKG_CONFIG_PATH, enter:
# export PKG_CONFIG_PATH=/usr/lib/pkgconfig/
Type the following commands:
# ./configure
Now compile and install RRDTool on RHEL:
# make
# make install
# ln -sf /opt/rrdtool-1.4.5/bin/rrdtool /usr/bin/rrdtool
# ln -sf /opt/rrdtool-1.4.5/bin/rrdupdate /usr/bin/rrdupdate
# ln -sf /opt/rrdtool-1.4.5/bin/rrdcgi /usr/bin/rrdcgi
# ln -sf /opt/rrdtool-1.4.5/bin/rrdupdate /usr/bin/rrdupdate
# ln -sf /opt/rrdtool-1.4.5/bin/rrdcgi /usr/bin/rrdcgi
How do I verify my installation?
Now RRDtool is installed and ready to use. You can go to /usr/local/rrdtool/share/rrdtool/examples/ directory and run them to see if your installation has been successful or not:
# cd /opt/rrdtool/share/rrdtool/examples/
# ./stripes.pl
# ls -l
# cp stripes.png /var/www/html/
Check on the web: http://your-domain.com/stripes.png
0 comments:
Post a Comment