Centos6.7安装Cacti教程
# link:http://docs.cacti.net/plugins/
blog地址:http://www.cnblogs.com/caoguo
一.基本环境安装
[[email protected] ~]# yum install -y gcc httpd php php-mysql php-snmp mysql mysql-devel mysql-server rrdtool [[email protected] ~]# yum install -y net-snmp net-snmp-devel net-snmp-utils wget ntp [[email protected] ~]# chkconfig ntpd on [[email protected] ~]# /etc/init.d/ntpd start [[email protected] ~]# sed -i "[email protected];date.timezone [email protected] = Asia/[email protected]" /etc/php.ini [[email protected] ~]# /etc/init.d/mysqld start [[email protected] ~]# chkconfig mysqld on [[email protected] ~]# mysql -uroot -p Enter password: mysql> create database cacti; mysql> create user [email protected] identified by ‘cactiuser‘; mysql> grant all on cacti.* to [email protected]; mysql> flush privileges;
二.cacti配置
[[email protected] ~]# cd /usr/local/src/ [[email protected] src]# tar zxf cacti-0.8.8f.tar.gz [[email protected] src]# cp -rf cacti-0.8.8f /var/www/html/cacti [[email protected] src]# cd cacti-0.8.8f [[email protected] cacti-0.8.8f]# mysql -h localhost -u cactiuser -p cacti<cacti.sql [[email protected] ~]# 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; ?> [[email protected] ~]# crontab -e */1 * * * * php /var/www/html/cacti/poller.php >/dev/null [[email protected] ~]# chkconfig httpd on [[email protected] ~]# /etc/init.d/httpd start
三.snmp服务配置
[[email protected] ~]# 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 <[email protected]> (configure /etc/snmp/snmp.local.conf) dontLogTCPWrappersConnects yes [[email protected] ~]# chkconfig snmpd on [[email protected] ~]# /etc/init.d/snmpd start
四.轮询插件spine安装
[[email protected] src]# tar zxf cacti-spine-0.8.8f.tar.gz [[email protected] src]# cd cacti-spine-0.8.8f [[email protected] cacti-spine-0.8.8f]# ./configure [[email protected] cacti-spine-0.8.8f]# make && make install [[email protected] cacti-spine-0.8.8f]# cp -rf /usr/local/spine/etc/spine.conf.dist /etc/spine.conf [[email protected] cacti-spine-0.8.8f]# ln -s /usr/local/spine/bin/spine /usr/bin/ [[email protected] ~]# vi /etc/spine.conf DB_Host localhost DB_Database cacti DB_User cactiuser DB_Pass cactiuser DB_Port 3306
五.cacti扩展插件安装
[[email protected] src]# wget http://docs.cacti.net/_media/plugin:monitor-v1.3-1.tgz -O monitor-v1.3-1.tgz [[email protected] src]# tar zxf monitor-v1.3-1.tgz [[email protected] src]# mv monitor /var/www/html/cacti/plugins/ [[email protected] src]# wget http://docs.cacti.net/_media/plugin:clog-v1.7-1.tgz -O clog-v1.7-1.tgz [[email protected] src]# tar zxf clog-v1.7-1.tgz [[email protected] src]# mv clog /var/www/html/cacti/plugins/ [[email protected] src]# wget http://docs.cacti.net/_media/plugin:settings-v0.71-1.tgz -O settings-v0.71-1.tgz [[email protected] src]# tar zxf settings-v0.71-1.tgz [[email protected] src]# mv settings /var/www/html/cacti/plugins/ [[email protected] src]# wget http://docs.cacti.net/_media/plugin:thold-v0.5.0.tgz -O thold-v0.5.0.tgz [[email protected] src]# tar zxf thold-v0.5.0.tgz [[email protected] src]# mv thold /var/www/html/cacti/plugins/
安装结束!!!
时间: 2024-07-30 10:12:31