快速业务通道

cacti监控 On RHEL6

作者 佚名技术 来源 Linux系统 浏览 发布时间 2012-03-26

1. Install required packages

# yum -y install httpd php php-mysql php-snmp mysql mysql-server net-snmp

2. Configure MySQL

# /etc/init.d/mysqld start

# mysqladmin --user=root create cacti
# mysql -u root -p

mysql>GRANT ALL on cacti.* TO cacti@localhost IDENTIFIED BY ''password'';

mydql>flush privileges;

3. Install and Configure Cacti

# tar xf cacti-0.8.7g.tar.gz

# cp -r cacti-0.8.7g /var/www/html/cacti

# cd /var/www/html/cacti

# mysql cacti < cacti.sql

# vim include/config.php

$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cacti";
$database_password = "password";

# useradd -s /sbin/nologin -M cacti

# chown -R cacti.cacti rra/ log/

# crontab -e

*/5 * * * * cacti php /var/www/html/cacti/poller.php > /dev/null 2>&1

注意:可以手动运行php /var/www/html/cacti/poller.php进行测试会发现有多WARNING:

PHP Warning: strtotime(): It is not safe to rely on the system''s timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected ''Asia/Chongqing'' for ''CST/8.0/no DST'' instead in /var/www/html/cacti/include/global_arrays.php on line 640

解决办法是:

# vim /etc/php.ini

date.timezone = PRC

# /etc/init.d/httpd restart

4. Install and Confiture Spine

# yum -y install automake libtool mysql-devel net-snmp-devel

# tar xf cacti-spine-0.8.7g.tar.gz
# cd cacti-spine-0.8.7g
# aclocal
# libtoolize --force
# autoheader
# autoconf
# automake
# ./configure
# make && make install && echo $?

# cp /usr/local/spine/etc/spine.conf.dist /usr/local/spine/etc/spine.conf

# vi /usr/local/spine/etc/spine.conf

DB_Host localhost
DB_Database cacti
DB_User cacti
DB_Pass password
DB_Port 3306
DB_PreG 0

5. Install and Configure rrdtool

# yum -y install libxml2-devel pango-devel cairo-devel perl-ExtUtils-MakeMaker

# tar xf rrdtool-1.4.4.tar.gz

# cd rrdtool-1.4.4

# ./configure

# make && make install && echo $?

6. Test and Further Configure

Use firefox to open the url: http://localhost/cacti





凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

分享到: 更多

Copyright ©1999-2011 厦门凌众科技有限公司 厦门优通互联科技开发有限公司 All rights reserved

地址(ADD):厦门软件园二期望海路63号701E(东南融通旁) 邮编(ZIP):361008

电话:0592-5908028 传真:0592-5908039 咨询信箱:web@lingzhong.cn 咨询OICQ:173723134

《中华人民共和国增值电信业务经营许可证》闽B2-20100024  ICP备案:闽ICP备05037997号