设为首页收藏本站

新微赢技术网

 找回密码
 注册
搜索
热搜: 回贴
查看: 15378|回复: 3
打印 上一主题 下一主题

cacti脚本。。基于linux+apache+mysql+php+zend 脚本

[复制链接]
跳转到指定楼层
1#
发表于 2009-11-29 01:35:27 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
#!/bin/sh
BUILD_DIR=`pwd`
yum -y install libart_lgpl
yum -y install ibart_lgpl-devel
yum -y install net-snmp-devel
yum -y install mysql-devel
yum -y install openssl-devel


echo "#############Install cgilib#######################"

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/

echo "注意:首次执行poller.php时请使用cacti用户,否则生成的rrd文件cacti将没有写入权限。"
echo "su cacti"
echo "/usr/local/bin/php /usr/local/apache2/htdocs/cacti/poller.php"
echo "su root"
echo "crontab –e"
echo "*/5 * * * * /usr/local/bin/php /usr/local/apache2/htdocs/cacti/poller.php > /dev/null 2>&1"
2#
发表于 2010-1-1 19:05:06 | 只看该作者
鉴定完毕!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

申请友链|小黑屋|最新主题|手机版|新微赢技术网 ( 苏ICP备08020429号 )  

GMT+8, 2024-11-20 01:35 , Processed in 0.122069 second(s), 11 queries , Gzip On, Memcache On.

Powered by xuexi

© 2001-2013 HaiAn.Com.Cn Inc. 寰耽

快速回复 返回顶部 返回列表