cacti安装
一、安装
1、配置好LAMP环境
我是用yum安装配置的
yum install perl-DBD-MySQL httpd mysql mysql-server php php-gd php-pdo php-mysql
2、如果没有安装mysql-devel在安装cactid的时候会报
configure: error: Cannot find MySQL header files
yum install mysql-devel
3、安装net-snmp-libs net-snmp net-snmp-utils 还需要安装net-snmp-devel不然会报configure: error: Cannot find SNMP headers.错误
rpm -ivh net-snmp-devel-5.1.2-13.el4.i386.rpm beecrypt-devel-3.1.0-6.i386.rpm elfutils-devel-0.97.1-5.i386.rpm elfutils-libelf-devel-0.97.1-5.i386.rpm
安装好后启动snmp服务
/etc/init.d/snmpd start
测试snmp是否运作,默认密码字段为public,可更改/etc/snmp/snmpd.conf 更你为你的密码字段
snmpwalk -v 2c -c public localhost system
4、解压cacti包并把包放入apache的工作目录里
mv cacti-0.8.7d /var/www/html/cacti
5、进入mysql把cacti的数据库导入
mysql> create database cacti;
mysql> use cacti;
mysql> source /var/www/html/cacti/cacti.sql
mysql> grant all on cacti.* to cacti@localhost identified by 'cacti';
6、进入cactid目录
./configure --prefix=/usr/local/cacti --with-mysql=/usr/ --with-net-snmp&& make && make install
7、把安装目录下生成的cactid.conf拷贝到
cp cactid cactid.conf /usr/local/cacti/bin/
8、
修改/usr/local/cacti/cactid.conf
修改config.php
[root@localhost cacti]# vi /var/www/html/cacti/include/config.php
9、进入cacti页面安装cacti
http://192.168.128.134:8080/cacti
10、cacti的默认用户名密码是admin
11、添加cacti用户
chown -R cacti.cacti /var/www/html/cacti
chown -R cacti.cacti /usr/local/cacti
12、#su - cacti
[cacti@localhost ~]$ /usr/bin/php /var/www/html/cacti/poller.php > /dev/null 2>&1
[cacti@localhost ~]$ crontab -e //加入下面
*/5 * * * * /usr/bin/php /var/www/html/cacti/poller.php > /dev/null 2>&1
未完部分详见附件,由于图片比较多,参考资料详见附件上述部分均来自石头记 snmp的相关配置见附件
附件:http://down.51cto.com/data/2353458
本文转自 qwjhq 51CTO博客,原文链接:http://blog.51cto.com/bingdian/181624