分类: LINUX
2005-11-30 22:34:13
1、
一般说来,图片的流量统计描述都是 |host_description| - Traffic - |query_ifName|
按照这个形式来描述的,对于华为的设备,Gi显示成GigabitEthernet,可能导致后面的模块号,端口好无法显示。如
GigabitEthernet4/3/2显示成GigabitEthernet,解决办法:
Console -> Settings -> Visual -> Maximum Field Length: 默认 15,我修改成30就OK了。
The maximum number of characters to display for a data query field.
2、对于Traffic 大于800Mbits/s的无法显示问题,在创建graph前修改 Data Templates -> Interface Traffic -> 1: traffic_in -> Maximum Value Use Per-Data Source Value 默认是100000000 后面再添 几个0就OK了,同样 2: traffic_out也要修改哦,最好在使用new graph创建新的graph之前修改后,否则之后修改会有一定的麻烦,甚至无法正常工作。
3、以前都是直接下载tar.gz源代码包安装的,按照readme就可以搞定一切。目前在FC4下可以直接通过yum instal cacti就安装完成,安装后却不知道怎么使用,也不知道安装到什么地方了,怎么让cacti工作。
首先了解rpm包安装了那些有用的文件:
rpm程序把cacit的php文件放到/usr/share/cacti目录下。
在/etc/httpd/conf.d/cacit.conf
==============================
#
# Cacti: An rrd based graphing tool
#
Alias /cacti /usr/share/cacti
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
==============================
在apache的配置里面只允许localhost访问/cacti这个虚拟目录。
[root@elm ~]# cd /etc/cron.d
[root@elm cron.d]# more cacti
*/5 * * * * cacti /usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1
[root@elm cron.d]#
定期执行程序的cron配置。
下面介绍如何让cacti工作:
首先,配置数据库:
[root@elm local]# cd /usr/share/doc/cacti-0.8.6h/
[root@elm cacti-0.8.6h]# ls
cacti.sql docs LICENSE README
[root@elm cacti-0.8.6h]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 312 to server version: 4.1.16
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> create database cacti_test;
Query OK, 1 row affected (0.12 sec)
mysql> \q
Bye
[root@elm cacti-0.8.6h]# mysql cacti_test < cacti.sql
修改cacit的配置文件:
[root@elm cacti-0.8.6h]# cd /usr/share/cacti/include/
[root@elm include]# cat db.php
/* make sure these values refect your actual database/host/user/password */
$database_type = "mysql";
$database_default = "cacti_test";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "cactipass";
$database_port = "3306";
?>
根据自己的需求修改。
OK,打开Firefox在地址栏输入: 进行配置。
默认用户名密码:admin:admin
5、如果在配置完毕后可以生成rrd文件,且里面有数据,但是在浏览器上无法看到png图片。现查看apache的log
如果出现:
========================
[Thu Feb 09 15:12:24 2006] [error] [client 127.0.0.1] File does not exist: /var/www/html/favicon.ico
ERROR: opening '/usr/share/cacti/rra/localhost_mem_buffers_3.rrd': Permission denied
ERROR: opening '/usr/share/cacti/rra/localhost_mem_buffers_3.rrd': Permission denied
ERROR: opening '/usr/share/cacti/rra/localhost_mem_buffers_3.rrd': Permission denied
ERROR: opening '/usr/share/cacti/rra/localhost_mem_buffers_3.rrd': Permission denied
ERROR: opening '/usr/share/cacti/rra/localhost_mem_buffers_3.rrd': Permission denied
ERROR: opening '/usr/share/cacti/rra/localhost_mem_buffers_3.rrd': Permission denied
ERROR: opening '/usr/share/cacti/rra/localhost_mem_buffers_3.rrd': Permission denied
ERROR: opening '/usr/share/cacti/rra/localhost_mem_buffers_3.rrd': Permission denied
=======================
[root@elm ~]# cd /usr/share/cacti/rra
[root@elm rra]# ls -lat
总用量 572
-rw-r--r-- 1 cacti cacti 141484 2月 9 19:15 localhost_load_1min_5.rrd
-rw-r--r-- 1 cacti cacti 47836 2月 9 19:15 localhost_mem_buffers_3.rrd
-rw-r--r-- 1 cacti cacti 47836 2月 9 19:15 localhost_mem_swap_4.rrd
-rw-r--r-- 1 cacti cacti 47836 2月 9 19:15 localhost_proc_7.rrd
-rw-r--r-- 1 cacti cacti 47836 2月 9 19:15 localhost_users_6.rrd
-rw-r--r-- 1 cacti cacti 94660 2月 9 19:15 tplink_input_13.rrd
-rw-r--r-- 1 cacti cacti 94660 2月 9 19:15 tplink_input_16.rrd
drwxr-xr-x 2 cacti root 4096 2月 9 18:35 .
drwxr-xr-x 4 root root 4096 2月 9 14:30 ..
[root@elm rra]#
Other也有R权限,那么请把机器的SElinux关闭,目前我不知道其他办法。
[root@elm rra]# cd /etc/selinux/
[root@elm selinux]# more config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted
[root@elm selinux]#
注意红色部分,重新启动机器后就OK了。
6、我只想显示整数怎么办?
修改Graph Templates下的Graph Template Items的GPRINT Type,改成Exact Number
7、我原来使用的是rrdtool-1.0.x 升级到 1.2.x 后部分图像无法显示(Zoom)
修改Configuration -> Settings -> RRDTool Utility Version -> 1.2.x