cacti安装教程
CentOS 6.0架设流量监控及集中日志系统
第一章、cacti的安装
1、 系统的基本设置
2、 设置主机名
3、 # vi /etc/sysconfig/network
4、 # exit
5、 重新登陆
6、 #
7、 安装screen后台运行程序
yum -y install screen
8、 安装优秀的编辑器vim
yum -y install vim
9、 执行screen -S cacti进程进行安装程序防止断开远程导致安装中断
10、 cacti所需组件
http
Mysql
mysql-server
Php
Php-mysql
Php-snmp
php-cli
php-common
Perl-DBD-MySQL
Php-pdo
rrdtool
Net-snmp
Net-snmp-libs
Net-snmp-utils
rrdtool
yum安装这些组件
yum -y install httpd php php-mysql php-snmp php-cli php-common mysql mysql-server net-snmp net-snmp-libs net-snmp-utils php-pdo perl-DBD-MySQL rrdtool
#下载cacti
# cd /home/
# wget http://www.cacti.net/downloads/cacti-0.8.7g.tar.gz
#解压cacti
# tar xvf cacti-0.8.7g.tar.gz
#进入cacti文件夹,将里面的文件移动到/var/www/html/
# cd cacti-0.8.7g
#
# mv * /var/www/html/
#启动apache及mysql服务
# /etc/init.d/httpd restart
Stopping httpd: [ OK ]
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using 61.140.3.66 for ServerName
[ OK ]
# /etc/init.d/mysqld restart
Stopping mysqld: [ OK ]
Starting mysqld: [ OK ]
#
#并将apache、mysql及network加入自启动
# chkconfig --level 35 httpd on
# chkconfig --level 35 mysqld on
#chkconfig network on
建立数据库
mysql> create database cacti;
mysql> grant all privileges on cacti.* to cactiuser@localhost identified by 'cacti' with grant option;
mysql>flush privileges;
导入cacti数据库
# mysql -h localhost -u cactiuser -p cacti/dev/null 2>&1
时间同步命令,每十分钟跟因特网同步时钟
*/10 * * * * ntpdate 210.72.145.44 > /dev/null 2>&1
并将rra和log文件夹赋予cactiuser以读写权限,poller.php文件赋予cactiuser用户运行权限
$ chmod 777 rra
$ chmod 777 log
$ chmod 755 poller.php
至此cacti安装完成,稍等五分钟刷新一下就可以出图
11、报错处理
1)/usr/bin/ld: cannot find -lmysqlclient 解决方法
原因是GCC 的默认搜索没有包含 /usr/lib/mysql
解决方法:
执行 export LIBRARY_PATH=/usr/lib/mysql
2)# make
false // No help2man // --output=spine.1 --name='Data Collector for Cacti' --no-info --version-option='--version' ./spine
make: *** Error 1报错
解决办法
需安装help2man解决
#yum -y install help2man
3)ERROR: YourCacti database login account does not haveaccess to the MySQL TimeZonedatabase. Please provide the Cacti databaseaccount "select" access to the "time_zone_name" table inthe "mysql" database, and populate MySQL's TimeZone informationbefore proceeding
错误解决办法
# grant all privileges on *.* to cacti@localhost identified by 'cacti';
# flush privileges;
4)ERROR: Your MySQL TimeZone database is not populated.Please populate this databasebefore proceeding.
解决办法# mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql
12、参考资料
Cacti官网:http://www.cacti.net/index.php
Cacti官网论坛:http://forums.cacti.net/
Cacti文档:http://docs.cacti.net/
Cacti插件:http://cactiusers.org/index.php
Network Weathermap:http://www.network-weathermap.com/
RRDTool官网:http://oss.oetiker.ch/rrdtool/
NET-SNMP官方网站:http://www.net-snmp.org/
Apache官网:http://httpd.apache.org/
MySQL官网:http://www.mysql.com/
PHP官网:http://www.php.net/
页:
[1]