搭建Cacti监控系统(四)
四、安装spineCacti 获取主机信息的方式有两种,系统默认是选择cmd 模式,还有一种方式是Spine ,这种方法是基于C语言的,非常快速的轮询引擎,效率比cmd 高很多。
(1)安装Spine依赖包
#yum install openssl-devel mysql-develnet-snmp-devel
(2)源码安装Spine
# tar zxvfcacti-spine-0.8.8a.tar.gz
#./configure --with-mysql=/usr/local/mysql/
# make&& make install
(3)Spine的配置文件spine.conf
# cd /usr/local/spine/etc/
# mv spine.conf.distspine.conf
# vim spine.conf
DB_Host localhost
DB_Database cacti
DB_User cacti
DB_Pass cacti
DB_Port 3306
DB_PreG 0
注意:这个版本的spine默认使用/tmp/mysqld.sock登陆MySQL。而我的LNMP环境在编译MySQL时指定的 为/tmp/mysql.sock。这时候可以用软链接的方法解决,也可以在spine.conf文件中指定sock文件,也就是修改DB_Host值为 mysql.sock文件的位置。
# cd /usr/local/spine/bin/
# ./spine
出现下面类似信息,说明没有问题:
Poller Time: 2.1460 s, Threads: 1,Hosts: 4
这里有一个报错:
# cd /usr/local/spine/bin/
# ./spine
./spine: error whileloading shared libraries: libmysqlclient.so.18: cannot open shared object file:No such file or directory
如我的mysql安装在/usr/local/mysql下
/usr/local/mysql/lib/libmysqlclient.so.18
#vim /etc/ld.so.conf
增加一行/usr/local/mysql/lib/
然后执行ldconfig生效即可
再次执行./spine 可以看到:
# ./spine
SPINE: Using spine config file[../etc/spine.conf]
SPINE: Version 0.8.8a starting
SPINE: Time: 0.1962 s, Threads: 1, Hosts: 3
(4)在console 配置spine
“Setting”-->“Paths”-->“Spine PollerFile Path”填写:/usr/local/spine/bin/spine;并“Save”
http://blog.运维网.com/pmghong/../attachment/201303/003001456.jpg
“Setting”-->“Poller”下修改Poller Type为Spine;并“Save”
http://blog.运维网.com/pmghong/../attachment/201303/003049771.png
页:
[1]