安装Cacti

安装CACTI

yum -y install gcc gcc-c++ tcl tcl-devel freetype freetype-devel mysql-server httpd  php php-snmp  php-mysql net-snmp  net-snmp-utils net-snmp-libs wget make libpng-devel libart_lgpl-devel

chkconfig mysqld on

chkconfig httpd on

chkconfig snmpd on

wget http://www.cacti.net/downloads/cacti-0.8.6j.tar.gz &&

wget http://www.cacti.net/downloads/patches/0.8.6j/ping_php_version4_snmpgetnext.patch &&

wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.2.23.tar.gz &&

wget http://www.guegue.com/~javier/cacti/ping_latency.pl &&

tar zxvf rrdtool-1.2.23.tar.gz &&

cd rrdtool-1.2.23 &&

./configure &&

make &&

make install &&

make clean &&

cd .. &&

/etc/init.d/mysqld start &&

/etc/init.d/httpd start &&

mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.bak &&

echo 'rocommunity 123456

disk /

disk /boot

disk /var '>/etc/snmp/snmpd.conf &&

/etc/init.d/snmpd start &&

mysqladmin -uroot password 123456 &&

mysqladmin -uroot -p123456 create cacti &&

tar zxvf cacti-0.8.6j.tar.gz &&

mv cacti-0.8.6j  /var/www/html/cacti &&

cd /var/www/html/cacti &&

mysql -uroot -p123456 cacti < cacti.sql &&

cd /root &&

cp ping_php_version4_snmpgetnext.patch /var/www/html/cacti &&

cd /var/www/html/cacti &&

patch -p1 -N < ping_php_version4_snmpgetnext.patch &&

useradd cactiuser -M -s /sbin/nologin &&

chown -R cactiuser:cactiuser /var/www/html/cacti &&

chmod -R 755 /var/www/html/cacti &&

cd include &&

#mv config.php config.php.bak

###


cd /root &&

cp ping_latency.pl /usr/local/bin/ &&

chmod 755 /usr/local/bin/ping_latency.pl &&

#echo '*/5 * * * * /usr/bin/php /var/www/html/cacti/poller.php > /dev/null 2>&1' >>/etc/crontab




在linux是添加snmp


yum -y install net-snmp net-snmp-devel


mv /etc/snmp/snmpd.conf  /etc/snmp/snmpd.conf.bak

echo 'rocommunity 123456

disk /

disk /boot

disk /var '>/etc/snmp/snmpd.conf

/etc/init.d/snmpd start

chkconfig snmpd on


你可能感兴趣的:(安装cacti)