刚开始有一个net-snmp-5.0.6-17包就足矣,一般默认安装的linux中没有 net-snmp-utils-5.0.6-17和net-snmp-devel-5.0.6-17这两个包,文章中提到的命令snmpwalk和snmpget可以在安装完这两个包后获得,默认路径是/usr/bin/snmpwalk,但安装完后不知道什么原因取远程服务器数据的时候在cacti日志中会报错:
12/07/2005 03:45:05 PM - CMDPHP: Poller[0] Host[4] DS[17] WARNING: Result from SNMP not valid. Partial Result;
这个问题好象在cacti forum中也没有解决,也有人说是net-snmp的版本bug
反正我在重新安装net-snmp-5.1.3.1.tar.gz包后在cacti中将snmpwalk和snmpget的路径重新修改后就可以执行了。这是我碰到最费劲的问题,其他的问题网上都有讨论和解决办法了。
安装net-snmp-5.1.3.1.tar.gz包
tar xzvf net-snmp-5.1.3.1.tar.gz
cd net-snmp-5.1.3.1
./configure
make
make install
安装过程中它会问你默认版本、用户名、perl模块和路径之类的问题,不理,一路回车。
#vi /etc/snmp/snmpd.conf
更改 1、com2sec notConfigUser default public
改为:com2sec notConfigUser 192.168.0.10 public
2、access notConfigGroup "" any noauth exact systemview none none
改为:access notConfigGroup "" any noauth exact all none none
3、#view all included .1 80
将前面的 # 注释 去掉。
保存退出 :wq
cd /sbin
service snmpd start
设置mysql
[root@Bleach php-4.3.10]#/usr/local/mysql/bin/mysql -u root –p123456
mysql> create database cactidb;
mysql> grant all on cactidb.* to root;
mysql> grant all on cactidb.* to root@localhost;
mysql> grant all on cactidb.* to cactiuser;
mysql> grant all on cactidb.* to cactiuser@localhost;
mysql> set password for cactiuser@localhost=password('cactipw');
安装rrdtool
[root@Bleach usr]# tar zxvf rrdtool-1.0.50.tar.gz
[root@Bleach usr]# cd rrdtool-1.0.50
[root@Bleach rrdtool-1.0.50]# ./configure
[root@Bleach rrdtool-1.0.50]#make && make install
安装cacti