Chinaunix首页 | 论坛 | 博客
  • 博客访问: 705726
  • 博文数量: 67
  • 博客积分: 3148
  • 博客等级: 中校
  • 技术积分: 1084
  • 用 户 组: 普通用户
  • 注册时间: 2010-11-10 14:33
文章分类

全部博文(67)

文章存档

2013年(2)

2012年(11)

2011年(33)

2010年(21)

我的朋友

分类: LINUX

2010-12-02 17:23:46

一、安装环境:
系统:AS5.0
您可以让 RPM 忽略依赖检查:
rpm -i --nodeps package
各种development包(gcc,gcc-c++)
httpd-2.2.3-11.el5_1.3rp
mysql-5.0.45-7.el5
mysql-devel-5.0.22-2.1.i386.rpm
mysql-server-5.0.45-7.el5.i386.rpm
php-5.1.6-20.el5
net-snmp-5.3.1-24.el5.i386.rpm
net-snmp-utils-5.3.1-24.el5.i386.rpm
net-snmp-devel-5.3.1-14.el5.i386.rpm
cacti-0.8.7d.tar.gz
rrdtool-1.2.23.tar.gz

php-snmp-5.1.6-20.el5.i386.rpm  //安装以下这两个包,主要解决打开index.php显示权限不够或空白的问题
php-mysql-5.1.6-20.el5
freetype-2.2.1-19.el5及开发包
libart_lgpl-2.3.17-4及开发包
libpng-1.2.10-7.1.el5_0.1及开发包
zlib-1.2.3-3及开发包
fonts-chinese-3.02-12.el5.noarch.rpm
(as4.0要把tcl及开发包装上)
 
二、cacti工作原理
   参考:
   cacti是一个协作平台,协调net-snmp\rrdtool\mysql一起来完成工作,通过在cacti上设置snmpget\snmpwalk来采集数据,设置rrdtool来储存数据以及画图,mysql保存模板、rra与主机对应等等信息
   ???rrdtool graph绘出的png格式的图片不知保存在哪里
 
三、详细安装步骤
1.关闭selinux (* 不需要此步骤也可以)
执行命令:setenforce 0
getenforce 查询selinux的运行状态
To disable it, you simply edit /etc/sysconfig/selinux file.
2.编译rrdtool
编辑src/rrd_graph.c
./configure
make
make install
#ifdef HAVE_SETLOCALE
    setlocale(LC_TIME,"");
#ifdef HAVE_MBSTOWCS
    setlocale(LC_ALL,"zh_CN.UTF-8");

3.cacti安装和调试
mysqladmin -uroot password superroot
mysqladmin -uroot -psuperroot create cacti
mysql -uroot -psuperroot cacti < /usr/local/cacti-0.8.7d/cacti.sql
mysql -uroot -psuperroot mysql
grant all on cacti.* to identified by 'cactiuser';
flush privileges;
编辑include/config.php
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "cactiuser";
$database_port = "3306";
解决rra/无法生成rrd文件的问题
cacti-0.8.7d]# chmod 777 rra
[root@Gdxte-Cacti cacti-0.8.7d]# chmod 777 rra/
[root@Gdxte-Cacti cacti-0.8.7d]# chown -R daemon.daemon *
[root@Gdxte-Cacti cacti-0.8.7d]# useradd -p cactiuser cactiuser
[root@Gdxte-Cacti cacti-0.8.7d]# chown -R cactiuser rra/ log/
[root@Gdxte-Cacti cacti-0.8.7d]# chmod 666 log/cacti.log
[root@Gdxte-Cacti cron]# crontab -e -u cactiuser
*/5 * * * * /usr/bin/php /var/www/html/cacti/poller.php > /dev/null 2>&1

4.http设置
vi /etc/httpd/conf/httpd.conf
Include conf.d/*.conf
# PHP is an HTML-embedded scripting language which attempts to make it
# easy for developers to write dynamically generated webpages.
LoadModule php5_module modules/libphp5.so
#
# Cause the PHP interpreter to handle files with a .php extension.
AddHandler php5-script .php
AddType text/html .php
#
# Add index.php to the list of files that will be served as directory
# indexes.
DirectoryIndex index.php

cd /var/www/html
ln -s /usr/local/cacti-0.8.7d cacti

安全方面的设置,关闭目录浏览功能:
找到   Options Indexes FollowSymLinks
修改成 Options -Indexes FollowSymLinks
找到
   
       Options FollowSymLinks
       AllowOverride None
       Order deny,allow
       Deny from all
       Options Indexes  (这一行是添加的)
  
[root@Gdxte-Cacti cacti-0.8.7d]# cd /var/www/html
[root@Gdxte-Cacti html]# ln -s /usr/local/cacti-0.8.7d cacti

5.安装、调试spine 
cd /usr/local/cacti-spine-0.8.7c
libtoolize --force
autoconf
autoheader
automake
./configure  //需要执行上面的,否则编译会出错
make;make install
[root@Gdxte-Cacti cacti-spine-0.8.7c]# cp spine.conf.dist /etc/spine.conf
vi /etc/my.cnf (如果是mysql4,需要修改my.cnf文件)
 key_buffer=32M
 query_cache_size=64M
在CACTI的SETTING界面选择使用SPINE
***
如果安装过程中出现下面报错:
Using `AC_PROG_RANLIB' is rendered obsolete by `AC_PROG_LIBTOOL'
libtoolize: `/usr/share/aclocal/libtool.m4' is serial 47, less than 48 in `aclocal.m4'
To remain compatible, you should update your `aclocal.m4' by running aclocal.
Putting files in AC_CONFIG_AUX_DIR, `config'.
执行aclocal就可以了,大概是收集本地信息的意思
阅读(3416) | 评论(1) | 转发(0) |
0

上一篇:linux操作小技巧

下一篇:世界时区表

给主人留下些什么吧!~~

chinaunix网友2010-12-03 15:53:05

很好的, 收藏了 推荐一个博客,提供很多免费软件编程电子书下载: http://free-ebooks.appspot.com