[dag]
name=Dag RPM Repository for Red Hat Enterprise Linux
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
gpgcheck=1
gpgkey=http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
enabled=1
yum install rrdtool
(3)配置snmp
vi /etc/snmp/snmpd.conf
将下边这行中的default
com2secnotConfigUser default public
改为127.0.0.1
com2secnotConfigUser 127.0.0.1 public
将下边这行中的systemview
access notConfigGroup "" any noauth exact systemview none none
改为all
access notConfigGroup "" any noauth exact all none none
将下边这行的注释“#”号去掉
#view all included .1 80
重启snmpd服务
service snmpd restart
(4)安装cacti
把解压后的包移动到你的相应的web目录
tar xvf cacti-0.8.7e.tar.gz
mv cacti-0.8.7e /var/www/html/cacti
(5)在数据库中建库、授权、导入数据库结构
注意导入cacti.sql时该文件的路径
mysql -p
mysql> create database cacti;
mysql> grant all privileges on cacti.* to cacti@localhost identified by 'cacti' with grant option;
mysql> grant all privileges on cacti.* to cacti@127.0.0.1 identified by 'cacti' with grant option;
mysql> use cacti;
mysql> source /var/www/html/cacti/cacti.sql;
access notConfigGroup "" any noauth exact systemview none none
改为all
access notConfigGroup "" any noauth exact all none none
将下边这行的注释“#”号去掉
#view all included .1 80
service snmpd restart
四、配置cacti监控mysql
(一)安装并配置mysql-cacti模板
wget http://mysql-cacti-templates.googlecode.com/files/mysql-cacti-templates-1.1.2.tar.gz
tar -xzvf mysql-cacti-templates-1.1.2.tar.gz
cd mysql-cacti-templates-1.1.2
cp ss_get_mysql_stats.php /xok.la/cacti/scripts
mysql> grant process,super on *.* to 'cacti'@'%' identified by 'cacti';
mysql> grant all privileges on cacti.* to cacti@"%" identified by "cacti";