Centos6.7安装Cacti教程
Centos6.7安装Cacti教程
# link:http://docs.cacti.net/plugins/
blog地址:http://www.cnblogs.com/caoguo
一.基本环境安装
[root@Cacti ~]# yum install -y gcc httpd php php-mysql php-snmp mysql mysql-devel mysql-server rrdtool [root@Cacti ~]# yum install -y net-snmp net-snmp-devel net-snmp-utils wget ntp [root@Cacti ~]# chkconfig ntpd on [root@Cacti ~]# /etc/init.d/ntpd start [root@Cacti ~]# sed -i "s@;date.timezone =@date.timezone = Asia/Chongqing@g" /etc/php.ini [root@Cacti ~]# /etc/init.d/mysqld start [root@Cacti ~]# chkconfig mysqld on [root@Cacti ~]# mysql -uroot -p Enter password: mysql> create database cacti; mysql> create user cactiuser@localhost identified by 'cactiuser'; mysql> grant all on cacti.* to cactiuser@localhost; mysql> flush privileges;
二.cacti配置
[root@Cacti ~]# cd /usr/local/src/ [root@Cacti src]# tar zxf cacti-0.8.8f.tar.gz [root@Cacti src]# cp -rf cacti-0.8.8f /var/www/html/cacti [root@Cacti src]# cd cacti-0.8.8f [root@Cacti cacti-0.8.8f]# mysql -h localhost -u cactiuser -p cacti<cacti.sql [root@Cacti ~]# vi /var/www/html/cacti/include/config.php <?php $database_type = "mysql"; $database_default = "cacti"; $database_hostname = "localhost"; $database_username = "cactiuser"; $database_password = "cactiuser"; $database_port = "3306"; $database_ssl = false; ?> [root@Cacti ~]# crontab -e */1 * * * * php /var/www/html/cacti/poller.php >/dev/null [root@Cacti ~]# chkconfig httpd on [root@Cacti ~]# /etc/init.d/httpd start
三.snmp服务配置
[root@Cacti ~]# cat /etc/snmp/snmpd.conf |grep -v -E '^#|^$' com2sec notConfigUser default public group notConfigGroup v1 notConfigUser group notConfigGroup v2c notConfigUser view systemview included .1.3.6.1.2.1.1 view systemview included .1.3.6.1.2.1.25.1.1 view systemview included .1.3.6.1.2.1.2 access notConfigGroup "" any noauth exact systemview none none syslocation Unknown (edit /etc/snmp/snmpd.conf) syscontact Root <root@localhost> (configure /etc/snmp/snmp.local.conf) dontLogTCPWrappersConnects yes [root@Cacti ~]# chkconfig snmpd on [root@Cacti ~]# /etc/init.d/snmpd start
四.轮询插件spine安装
[root@Cacti src]# tar zxf cacti-spine-0.8.8f.tar.gz [root@Cacti src]# cd cacti-spine-0.8.8f [root@Cacti cacti-spine-0.8.8f]# ./configure [root@Cacti cacti-spine-0.8.8f]# make && make install [root@Cacti cacti-spine-0.8.8f]# cp -rf /usr/local/spine/etc/spine.conf.dist /etc/spine.conf [root@Cacti cacti-spine-0.8.8f]# ln -s /usr/local/spine/bin/spine /usr/bin/ [root@Cacti ~]# vi /etc/spine.conf DB_Host localhost DB_Database cacti DB_User cactiuser DB_Pass cactiuser DB_Port 3306
五.cacti扩展插件安装
[root@Cacti src]# wget http://docs.cacti.net/_media/plugin:monitor-v1.3-1.tgz -O monitor-v1.3-1.tgz [root@Cacti src]# tar zxf monitor-v1.3-1.tgz [root@Cacti src]# mv monitor /var/www/html/cacti/plugins/ [root@Cacti src]# wget http://docs.cacti.net/_media/plugin:clog-v1.7-1.tgz -O clog-v1.7-1.tgz [root@Cacti src]# tar zxf clog-v1.7-1.tgz [root@Cacti src]# mv clog /var/www/html/cacti/plugins/ [root@Cacti src]# wget http://docs.cacti.net/_media/plugin:settings-v0.71-1.tgz -O settings-v0.71-1.tgz [root@Cacti src]# tar zxf settings-v0.71-1.tgz [root@Cacti src]# mv settings /var/www/html/cacti/plugins/ [root@Cacti src]# wget http://docs.cacti.net/_media/plugin:thold-v0.5.0.tgz -O thold-v0.5.0.tgz [root@Cacti src]# tar zxf thold-v0.5.0.tgz [root@Cacti src]# mv thold /var/www/html/cacti/plugins/
安装结束!!!