今天介绍的是服务器的安装软件cacti,昨天介绍的那个mrtg适合单点服务器,因为它的配置比较复杂,而且你要知道每一个oid,才能对其进行监控,然后很早以前就出现了它的替代品,叫什么来着忘了,但是现在这个cacti相对于配置来说很简单,而且多点监控起来比起mrtg那不是一个档次的!上边纯属我个人的废话!(1)安装lnmp http://yun.widuu.com/archives/08/762.html //根据我这里详细配置吧 (2)安装snmp 昨天也说了
yum install -y net-snmp* vim /etc/snmp/snmpd.conf rocommunity public 192.168.1.101 service snmpd start chkconfig snmpd start(4)rrdtool 安装为防止错误我们要安装依赖包
yum install cairo cairo-devel libxml2 libxml2-devel pango pango-devel perl perl-devel//下载安装rrdtool
wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.4.7.tar.gz tar zxf rrdtool-1.4.7.tar.gz cd rrdtool-1.4.7 ./configure --prefix=/usr/local/rrdtool make && make install ln -s /usr/local/rrdtoo/bin/* /usr/local/bin///安装spine
wget http://www.cacti.net/downloads/spine/cacti-spine-0.8.8b.tar.gz ln -s /usr/local/mysql/lib/libmysql* /usr/lib/ ./configure --prefix=/usr/local/spine make && make install ln -s /usr/local/spine/etc/spine.conf /etc///安装cacti
wget http://www.cacti.net/downloads/cacti-0.8.8a.tar.gz mv cacti-0.8.8a /usr/local/nginx/html/cacti//中文版的
wget http://blogimg.chinaunix.net/blog/upfile2/090815172648.gz tar -zxvf 090815172648.gz mkdir /usr/local/nginx/html/cacti cp -rf cacti-0.8.7e-cn-utf8/* /usr/local/nginx/html/cacti//配置数据库
Mysql>create database cacti default charset=utf8; Mysql>grant all on cacti.* to cacti@’localhost’ identified by ’cacti’; Mysql>flush privileges; Mysql>quit;导入cacti数据库
cd /usr/local/nginx/html/cacti mysql -uroot -p123456 cacti < cacti.sql//修改你的配置文件 数据库地址和目录地址
vi /usr/local/nginx/html/cacti/include/config.php//重启php 和 nginx //然后设置定时任务
Crontab -e */5 * * * * /usr/local/php/bin/php /usr/local/nginx/html/cacti/poller.php > /dev/null 2>&1然后我们看下效果,监控本地 监控远程服务器
发表评论 取消回复