- 论坛徽章:
- 0
|
首先,大家抱着学习态度看一下Cacti 0.8.6h的官方INSTALL,安装后位于 /var/www/html/cacti/docs下
cat INSTALL
Chapter 2. Installing Under Unix
1. Extract the distribution tarball.
shell> tar xzvf cacti-version.tar.gz
2. Create the MySQL database:
shell> mysqladmin --user=root create cacti
3. Import the default cacti database:
shell> mysql cacti < cacti.sql
4. Optional: Create a MySQL username and password for Cacti.
shell> mysql --user=root mysql
mysql> GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'somepassword';
mysql> flush privileges;
5. Edit include/config.php and specify the MySQL user, password and
database for your Cacti configuration.
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "cacti";
6. Set the appropriate permissions on cacti's directories for graph/log
generation. You should execute these commands from inside cacti's
directory to change the permissions.
shell> chown -R cactiuser rra/ log/
(Enter a valid username for cactiuser, this user will also be used in
the next step for data gathering.)
7. Add a line to your /etc/crontab file similar to:
*/5 * * * * cactiuser php /var/www/html/cacti/poller.php > /dev/null 2>&1
Replace cactiuser with the valid user specified in the previous step.
Replace /var/www/html/cacti/ with your full Cacti path.
8. Point your web browser to:
http://your-server/cacti/
Log in the with a username/password of admin. You will be required to
change this password immediately. Make sure to fill in all of the path
variables carefully and correctly on the following screen.
很简单是吧,下面开始我们的傻瓜化完全无Tarbll安装之旅,安装环境是Centos 4.3 single server CD的系统,所以,除了apache/php/mysql也没啥东西,而且现有系统还跑着个PHPBB和postfix,不能为了个流量监控伤筋动骨。所有的组件都是centos自己带的,基本上是默认安装
一。安装 net-snmp
yum install net-snmp*
注意加个*,把所有的咚咚都装上,否则没有cacti需要的命令.
二。安装 php-snmp
yum install php-snmp
所有CU的cacti文章都没提到这个组件,可是我rpm cacti的时候确实需要了,管它呢,咱有yum
三.安装rrdtool
wget ftp://ftp.pbone.net/mirror/atrpms.net/el4-i386/atrpms/stable/rrdtool-1.0.50-25.el4.at.i386.rpm
rpm -ivh rrdtool-1.0.50-25.el4.at.i386.rpm
四。安装cacti
wget http://www.cacti.net/downloads/packages/Fedora/4/cacti-0.8.6h.fc4.i386.rpm
rpm -ivh cacti-0.8.6h.fc4.i386.rpm
基本上,该装的都装了,我们只要完成最开始的INSTALL里的2,3,4,5,7就可以了,因为rpm把1,6都给做了,包括建立系统用户
五。 mysqladmin --user=root create cacti
注意,mysql有密码的自己添加密码,我的mysql因为只给localhost的php用,所以没加密码,直接copy执行
六。mysql cacti < /var/www/html/cacti/cacti.sql
俺把路径加上了
七。shell> mysql --user=root mysql
mysql> GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'somepassword';
mysql> flush privileges;
这个就照着install做吧,不过把这个'somepassword'替换成自己需要的密码,如果密码设置为'cacti',第八部可以不作
八。vi /var/www/html/cacti/include/config.php
$database_password = "cacti";
就改这一行口令就可以了,别的都是默认
九。crontab -e
插入
*/5 * * * * cactiuser php /var/www/html/cacti/poller.php > /dev/null 2>&1
保存退出。
现在 键入http://yourserver/cacti看看吧,如果没有页面的话,首先检查一下你的apache的Document root是不是 /var/www/html,要是不是的话,自己换一下目录指向或者干脆给cacti建立个虚拟主机
其实呢,虽然步骤多,可是实际上没什么高难度操作,而且N多的软件包依赖靠yum了,真舒服啊
对了,进入cacti的设置界面之后,如果找不到那几个snmp的命令,把路径改称/usr/bin即可
剩下的使用就是瞎摸索了,注意graph permission三个条件是相乘关系
[[i] 本帖最后由 sirz 于 2006-9-28 18:53 编辑 [/i]] |
|