cacti安装参考文章:
我就简要说一下,因为我按照他的安装出现了一个问题。
1:安装rrdtool
可以直接yum install rrdtool rrdtool-devel rrdtool-php
或者到 可以下载fedora版本的rrdtool相应的程序
安装
yum -y localinstall --nogpgcheck rrdtool*把三个都安装了。
然后再终端输入rrdtool 出现一下内容,说明安装成功,
RRDtool 1.4.4 Copyright 1997-2010 by Tobias Oetiker <tobi@oetiker.ch>
Compiled Jun 17 2011 09:03:31
Usage: rrdtool [options] command command_options
Valid commands: create, update, updatev, graph, graphv, dump, restore,
last, lastupdate, first, info, fetch, tune,
resize, xport, flushcached
RRDtool is distributed under the Terms of the GNU General
Public License Version 2. (www.gnu.org/copyleft/gpl.html)
For more information read the RRD manpages
mysql> create database cactidb;
mysql> grant all privileges on cactidb.* to cactier@localhost identified by '111111';
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.06 sec)
如果没有net-snmp 还要安装net-snmp
net-snmp-5.7.1-2.fc16.i686
net-snmp-libs-5.7.1-2.fc16.i686
net-snmp-utils-5.7.1-2.fc16.i686
yum install net-snmp net-snmp-libs net-snmp-utils
mv cacti /usr/local/apache/htdocs/cacti
/usr/local/apache 这是apache的主目录。别人是放在/var/www/html/cacti目录下,(我猜,这是他们的apache的目录,如果不是可以在httpd.conf中配置)
cd /usr/local/apache/htdocs/cacti
mysql -uroot -p cactidb < cacti.sql
##将cacti.sql数据库文件导入,会提示输入密码输入前面设置的root 的密码即可 配置cacti/include 目录下的config.php global.php
database/host/user/password */
$database_type = "mysql";
$database_default = "cactidb"; //数据库名字
$database_hostname = "localhost";
$database_username = "cactier"; //数据库用户
$database_password = "111111"; //密码
Edit this to point to the default URL of your Cacti install
ex: if your cacti install as at http://serverip/cacti/ this
$url_path = "/cacti/"; //这是我添加的
/* Default database settings*/
$database_type = "mysql";
$database_default = "cactidb";
$database_hostname = "localhost";
$database_username = "cactier";
$database_password = "111111";
$url_path = "/cacti";//这也是修改的
chown -R cactier rra/ log/ #指定rra/ log/的属组属主为cactier用户 要选择好每个地方的文件注意我的php在 /usr/local/php/bin/php
默认是 用户名:admin 密码:admin
PATH=/sbin:/bin:/usr/sbin:/usr/bin
*/5 * * * * cactier /usr/local/php/bin/php /usr/local/apache/htdocs/cacti/poller.php > /dev/null 2>&1 # For details see man 4 crontabs
# Example of job definition:
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# * * * * * user-name command to be executed
/usr/local/php/bin/php /usr/local/apache/htdocs/cacti/poller.php
其实我也不知道为什么。本来我以为是rrdtool没安装成功, 但是测试结果却是出现了。那么就是rrdtool没有执行,但是我也不懂rrdtool是如何执行的。但是cacti既然要先安装rrdtool那么,在cacti中rrdtool就得自动执行,不需要我们来执行。就这样陷入困惑了。无意之中,我点击了console-->devices选项发现
中status 出现unknown 我就不明白了,为什么会unknown呢?
我就点击了localhost 然后,在出现的页面右上角点击create graphs for this host 这样的话就好了。其实我也不懂为什么就出图了, rra目录下也有rrd文件了。至此就算出不安装成功了。我也就进行到这了