cd $BUILD_DIR
tar zxvf cgilib-0.5.tar.gz
cd cgilib-0.5
make
cp libcgi.a /usr/local/lib
cp cgi.h /usr/include
echo "#############Install rrdtool#######################"
cd $BUILD_DIR
tar zxvf rrdtool-1.2.27.tar.gz
cd rrdtool-1.2.27
./configure --prefix=/usr/local/rrdtool
make
make install
ln –s /usr/local/rrdtool/bin/* /usr/local/bin/
echo "/usr/local/rrdtool/lib" >> /etc/ld.so.conf
echo "#############Install net-snmp#######################"
echo "#############I修改snmpd.conf(修改COMMUNITY、允许抓取snmp数据的主机、抓取数据范围等)##########"
cd $BUILD_DIR
tar zxvf net-snmp-5.4.2.tar.gz
cd net-snmp-5.4.2
./configure --prefix=/usr/local/net-snmp --enable-developer
make
make install
ln –s /usr/local/net-snmp/bin/* /usr/local/bin/
cp $BUILD_DIR/snmpd.conf /usr/local/net-snmp/share/snmp/snmpd.conf
/usr/local/net-snmp/sbin/snmpd
echo "/usr/local/net-snmp/sbin/snmpd" >> /etc/rc.d/rc.local
echo "#############Install cacti#######################"
cd $BUILD_DIR
tar zxvf cacti-0.8.7b.tar.gz
cd cacti-0.8.7b
mv cacti-0.8.7b /usr/local/apache2/htdocs/cacti
mv /usr/local/apache2/htdocs/cacti/include/config.php /usr/local/apache2/htdocs/cacti/include/config.phpbak
cp $BUILD_DIR/config.php /usr/local/apache2/htdocs/cacti/include/
useradd cacti
chown -R cacti /usr/local/apache2/htdocs/cacti/rra
chgrp –R cacti /usr/local/apache2/htdocs/cacti
echo "#############Install 创建cacti数据库######################"
mysql –uroot –pmysqladmin
create database cacti;
grant all on cacti.* to cacti@localhost identified by “cacti”;
exit
cd /usr/local/apache2/htdocs/cacti/
mysql –uroot –pmysqladmin cacti < cacti.sql
mv /usr/local/Zend/etc/php.ini /usr/local/Zend/etc/php.inibak
cp $BUILD_DIR/php.ini /usr/local/Zend/etc/