1. 下载cacti-spine,必须和自己的cacti版本相一致,我版本为0.8.7g
- wget http://www.cacti.net/downloads/spine/cacti-spine-0.8.7g.tar.gz -P /usr/local/src
2. 解压,编译,安装
- tar zxvf /usr/local/src/cacti-spine-0.8.7g.tar.gz -C /usr/local/src
- cd /usr/local/src/cacti-spine-0.8.7.g
- ./configure --with-mysql=/usr/local/mysql
- make
- make install
--with-mysql=/usr/local/mysql
我的mysql安装路径为/usr/local/mysql
默认的安装路径为/usr/local/spine
3. 添加配置文件
- cd /usr/local/spine/etc
- cp spine.conf.dist spine.conf
- vi spine.conf
- DB_Host 192.168.1.10
- DB_Database cacti
- DB_User cacti
- DB_Pass xxxxxx
- DB_Port 3306
- DB_PreG 0
4. 测试spine
- /usr/local/spine/bin/spine
- SPINE: Using spine config file [spine.conf]
- SPINE: Version 0.8.7g starting
- SPINE: Time: 2.1642 s, Threads: 1, Hosts: 6
没有报错,进行配置cacti
5. cacti设置
a. 点击"console",选择"configuration"中的"Settings",选择Paths选项卡,对"Alternate Poller Path"设置spine的位置,如下图:设置为/usr/local/spine/bin/spine
点击"save"按钮保存。
b. 选择"Poller选项卡",修改"Poller Type"为"spine",如下图
点击"save"按钮保存。
6. 日志检查
- tail /data/www/cacti/log/cacti.log
- ……
- 07/28/2011 05:00:04 PM – SYSTEM STATS: Time:3.1515 Method:spine Processes:1 Threads:1 Hosts:6 HostsPerProcess:6 DataSources:44 RRDsProcessed:37
通过以上可以看出spine正常运行。