安装前提前安装好相关的组件.
yum install cairo-devel libxml2-devel pango-devel pango libpng-devel freetype freetype-devel libart_lgpl-devel intltool php-gd php-xml net-snmp-utils perl-XML-Parser
安装MySQL数据库
yum install mysql mysql-server
chkconfig mysqld on
service mysqld start
安装Apache HTTP Server
yum install httpd
chkconfig httpd on
安装PHP脚本支持
yum install php
添加PHP-MySQL等支持
yum install php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc net*
编写测试页面
vi /var/www/html/info.php
将以下内容贴至文件中,保存退出
<?php phpinfo();?>
安装rrdtool,rrdtool不能直接通过yum安装,可以加入Dag RPM Repository以便让yum能找到rrdtool
#wget http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
#rpm -Uvh rpmforge-release-0.3.6-1.el5.rf.i386.rpm
#yum install rrdtool
# yum -y install net-snmp net-snmp-utils net-snmp-libs
编辑SNMP配置文件
# vim /etc/snmp/snmpd.conf
更改 com2sec notConfigUser default public
改为 com2sec notConfigUser IP地址 public #注 192.168.40.120 是安装cacti服务器IP,指定只有这IP才能获取本机的SNMP信息 提高安全性
更改 access notConfigGroup "" any noauth exact systemview none none
改为 access notConfigGroup "" any noauth exact all none none
将 #view all included .1 80 前面的 # 注释去掉
启动snmpd服务 service snmpd start
将snmpd加入开机启动
chkconfig --add snmpd
chkconfig -- snmpd on
wget http://192.168.40.200/cacti-0.8.7h.zip //下载程序
tar xf cacti-0.8.7h.tar.gz //解压程序
mv cacti-0.8.7h /var/www/html/cacti //移动目录动/html下
mysql -uroot -p
Enter password: //输入管理员密码进入系统
Mysql>create database cacti;
Mysql>grant all on cacti.* to cacti@'localhost' identified by 'cacti';
Mysql>flush privileges;
导入cacti数据库
mysql> source /var/www/html/cacti/cacti.sql
Vim /var/www/html/cacti/include/ config.php //填写用户名,密码
chmod -R 777 rra log