准备工具:
rrdtool:http://oss.oetiker.ch/rrdtool/pub/(rrdtool-1.4.8.tar.gz)
yum安装httpd mysql php:yum install httpd php php-mysql mysql mysql-server
snmp:www.net-snmp.org/下载 (net-snmp-5.7.2.1.zip)
cacti:http://www.cacti.net/ (cacti-0.8.8b.zip)
关闭selinux
*在安装rrdtoo软件会出现错误安装不上,可能需要把以下组件安装:
yum install cairo-devel libxml2-devel pango-devel pango libpng-devel freetype freetype-devel libart_lgpl-devel
# 安装Apache+MySQL+PHP
yum -y install httpd php mysql mysql-server php-mysql
# 安装apache扩展
yum -y install httpd-manual mod_ssl mod_perl mod_auth_mysql
# 安装php的扩展
yum install php-gd
yum -y install php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc
# 安装mysql扩展
yum -y install mysql-connector-odbcmysql-devel libdbi-dbd-mysql
yum �Cy install libart_lgpl-devel
yum �Cy install pango-devel* cairo-devel*
rrdtool安装步骤:
tar -zxvf rrdtool-1.4.7.tar.gz
cd rrdtool-1.4.7
./configure --prefix=/usr/local/rrdtool/
make
make install
cd /usr/local/rrdtool/bin;cp * /usr/local/bin
net-snmp安装步骤:
unzip net-snmp-5.7.2.1.zip
cd net-snmp-5.7.2.1
./configure --prefix=/usr/local/snmpd
*安装过程会提示安装路径,我执行的是/usr/local/snmpd/
make
make install
cacti安装步骤:
tar -zxvf cacti-0.8.8b.tar.g
mv cacti-0.8.8b cacti
mv cacti /var/www/html/
然后在mysql新建数据库信息:
create database cacti;
grant all on cacti.* to cacti@'localhost' identified by 'cacti123';
mysql -uroot -p cacti<cacti.sql 导入cacti数据库文件
chown -R root rra/ log/ 给这两个文件权限
crontab -e
*/5 * * * * /usr/local/bin/php /home/wwwroot/cacti/poller.php > /dev/null 2>&1
计划任务
http://IP/cacti 进行登录访问
patch -R rrd.php < wKioOVNEuufyTELMAAAJwCtAw4o999.txt (出现RRDTool Says: ERROR: Expected some arguments after 'COMMENT:'需要打上补丁)
本文出自 “大王好帅” 博客,转载请与作者联系!