LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 7652|回复: 6

cacti不能显示图像,rra下没有文件!权限,PATH,snmpwalk没问题

[复制链接]
发表于 2007-4-23 16:13:28 | 显示全部楼层 |阅读模式
装好了cacti,登录进去,发现不能显示图像
主要问题是rra下死活不能生成*.rrd文件
centos 4.4 ,rrdtool-1.0.50,mysql-4.1.20-1.RHEL4.1,cacti0.8.6i,cacti0.8.6j都试过

参考了http://bbs.chinaunix.net/viewthread.php?tid=648262

ll

drwxr-xr-x 2 cactiuser root   4096 Apr 23 15:10 rra

这个目录即使给777也一样


Data Source Debug

/usr/local/rrdtool/bin/rrdtool create \
/var/www/html/cacti/rra/202_111_111_31_cpu_system_12.rrd \
--step 300  \
DS:cpu_system:COUNTER:600:0:100 \
RRA:AVERAGE:0.5:1:600 \
RRA:AVERAGE:0.5:6:700 \
RRA:AVERAGE:0.5:24:775 \
RRA:AVERAGE:0.5:288:797 \
RRA:MAX:0.5:1:600 \
RRA:MAX:0.5:6:700 \
RRA:MAX:0.5:24:775 \
RRA:MAX:0.5:288:797 \





RRDTool Command:

/usr/local/rrdtool/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="202.111.111.31 - Traffic" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="bits per second" \
DEF:a="/var/www/html/cacti/rra/202_111_111_31_traffic_in_13.rrd":traffic_in:AVERAGE \
DEF:b="/var/www/html/cacti/rra/202_111_111_31_traffic_in_13.rrd":traffic_out:AVERAGE \
CDEF:cdefa=a,8,* \
CDEF:cdefe=b,8,* \
AREA:cdefa#00CF00:"Inbound"  \
GPRINT:cdefaAST:" Current\:%8.2lf %s"  \
GPRINT:cdefa:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:cdefa:MAX:"Maximum\:%8.2lf %s\n"  \
LINE1:cdefe#002A97:"Outbound"  \
GPRINT:cdefeAST:"Current\:%8.2lf %s"  \
GPRINT:cdefe:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:cdefe:MAX:"Maximum\:%8.2lf %s"
RRDTool Says:

ERROR: opening '/var/www/html/cacti/rra/202_111_111_31_traffic_in_13.rrd': No such file or directory
死活不能创建文件


snmpwalk -v 2c -c public yourIP if

IF-MIB::ifIndex.1 = INTEGER: 1
IF-MIB::ifIndex.2 = INTEGER: 2
IF-MIB::ifIndex.3 = INTEGER: 3
IF-MIB::ifDescr.1 = STRING: lo
IF-MIB::ifDescr.2 = STRING: eth0
IF-MIB::ifDescr.3 = STRING: sit0
IF-MIB::ifType.1 = INTEGER: softwareLoopback(24)
IF-MIB::ifType.2 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifType.3 = INTEGER: tunnel(131)
IF-MIB::ifMtu.1 = INTEGER: 16436
IF-MIB::ifMtu.2 = INTEGER: 1500
IF-MIB::ifMtu.3 = INTEGER: 1480
IF-MIB::ifSpeed.1 = Gauge32: 10000000
IF-MIB::ifSpeed.2 = Gauge32: 100000000
IF-MIB::ifSpeed.3 = Gauge32: 0
IF-MIB::ifPhysAddress.1 = STRING:
IF-MIB::ifPhysAddress.2 = STRING: 0:50:ba:f1:55:1d
IF-MIB::ifPhysAddress.3 = STRING:
IF-MIB::ifAdminStatus.1 = INTEGER: up(1)
IF-MIB::ifAdminStatus.2 = INTEGER: up(1)
IF-MIB::ifAdminStatus.3 = INTEGER: down(2)
IF-MIB::ifOperStatus.1 = INTEGER: up(1)
IF-MIB::ifOperStatus.2 = INTEGER: up(1)
IF-MIB::ifOperStatus.3 = INTEGER: down(2)
IF-MIB::ifInOctets.1 = Counter32: 6339042
IF-MIB::ifInOctets.2 = Counter32: 624701792
IF-MIB::ifInOctets.3 = Counter32: 0
IF-MIB::ifInUcastPkts.1 = Counter32: 46116
IF-MIB::ifInUcastPkts.2 = Counter32: 672511
IF-MIB::ifInUcastPkts.3 = Counter32: 0
IF-MIB::ifInDiscards.1 = Counter32: 0
IF-MIB::ifInDiscards.2 = Counter32: 0
IF-MIB::ifInDiscards.3 = Counter32: 0
IF-MIB::ifInErrors.1 = Counter32: 0
IF-MIB::ifInErrors.2 = Counter32: 0
IF-MIB::ifInErrors.3 = Counter32: 0
IF-MIB::ifOutOctets.1 = Counter32: 6340815
IF-MIB::ifOutOctets.2 = Counter32: 40387283
IF-MIB::ifOutOctets.3 = Counter32: 0
IF-MIB::ifOutUcastPkts.1 = Counter32: 46140
IF-MIB::ifOutUcastPkts.2 = Counter32: 364564
IF-MIB::ifOutUcastPkts.3 = Counter32: 0
IF-MIB::ifOutDiscards.1 = Counter32: 0
IF-MIB::ifOutDiscards.2 = Counter32: 0
IF-MIB::ifOutDiscards.3 = Counter32: 0
IF-MIB::ifOutErrors.1 = Counter32: 0
IF-MIB::ifOutErrors.2 = Counter32: 0
IF-MIB::ifOutErrors.3 = Counter32: 0
IF-MIB::ifOutQLen.1 = Gauge32: 0
IF-MIB::ifOutQLen.2 = Gauge32: 0
IF-MIB::ifOutQLen.3 = Gauge32: 0
IF-MIB::ifSpecific.1 = OID: SNMPv2-SMI::zeroDotZero
IF-MIB::ifSpecific.2 = OID: SNMPv2-SMI::zeroDotZero
IF-MIB::ifSpecific.3 = OID: SNMPv2-SMI::zeroDotZero

一直没问题


#php /var/www/html/cacti/cmd.php
Content-type: text/html
X-Powered-By: PHP/4.3.9

04/23/2007 03:10:21 PM - CMDPHP: Poller[0] Host[2] DS[9] WARNING: Result from SNMP not valid.  Partial Result:
04/23/2007 03:10:21 PM - CMDPHP: Poller[0] Host[2] DS[10] WARNING: Result from SNMP not valid.  Partial Result:
04/23/2007 03:10:21 PM - CMDPHP: Poller[0] Host[3] DS[12] WARNING: Result from SNMP not valid.  Partial Result:
04/23/2007 03:10:21 PM - CMDPHP: Poller[0] Time: 0.4547 s, Theads: N/A, Hosts: 3
You have new mail in /var/spool/mail/cactiuser

#php /var/www/html/cacti/poller.php
OK u:0.00 s:0.01 r:0.07
OK u:0.00 s:0.01 r:0.07
OK u:0.00 s:0.01 r:0.07
OK u:0.00 s:0.01 r:0.07
OK u:0.01 s:0.01 r:0.11
OK u:0.01 s:0.01 r:0.11
ERROR: illegal attempt to update using time 1177312226 when last update time is 1177312226 (minimum one second step)
Content-type: text/html
X-Powered-By: PHP/4.3.9

04/23/2007 03:10:26 PM - SYSTEM STATS: Time:1.3502 Method:cmd.php Processes:1 Threads:N/A Hosts:4 HostsPerProcess:4 DataSources:9 RRDsProcessed:18

另外,1:除了监控linux本机,还建了一个host监控winxp,同样图像出不来。(winxp的snmp装了,snmpwalk同样没问题)
2:cacti0.8.6j解压后权限很奇怪,即使我chown root.root cacti-0.8.6j,chmod -R 777 cacti-0.8.6j也不能运行php,cp出来就可以
drwxr-xr-x  11 1000 users 4096 Jan 18 08:23 cacti-0.8.6j

请求大家帮忙。
发表于 2007-4-28 08:39:16 | 显示全部楼层
通常情况下,cacti是以web服务的用户来运行的,因此在cacti目录下的log 和 rra 目录及其下的所有文件的所有者应该设置为那么用户(比如www-data)。

因此:
chown -R www-data.www-data $CACTIPATH/log
chown -R www-data.www-data $CACTIPATH/rra

chmod 755 $CACTIPATH/log
chmod 755 $CACTIPATH/rra

还有,如果你用root用户运行过cmd.php,那么有可能在rra目录下生成了拥有者为root的一些rrd文件,你需要将这些文件的所有者改成运行www服务的那么用户。
回复 支持 反对

使用道具 举报

发表于 2008-6-23 12:05:15 | 显示全部楼层
drwxrwxrwx 2 www-data www-data     80 Feb 13 10:19 rra


死活不写入。开始怀疑是php的问题了
回复 支持 反对

使用道具 举报

发表于 2008-6-30 14:39:16 | 显示全部楼层
我也是这个问题

drwxrwxrwx    2 cacti    cacti        4096  2月 12 08:57 log
-rw-r--r--    1 root     cacti        2451  2月 12 08:57 logout.php
-rw-r--r--    1 root     cacti        4306  2月 12 08:57 poller_commands.php
-rw-r--r--    1 root     cacti        2243  2月 12 08:57 poller_export.php
-rw-r--r--    1 root     cacti       14960  2月 12 08:57 poller.php
-rw-r--r--    1 root     cacti          71  2月 12 08:57 README
drwxr-xr-x    5 root     cacti        4096  2月 12 08:57 resource
drwxrwxrwx    2 cacti    cacti        4096  6月 30 14:22 rra

rra和log都是cacti组,cacti均有权限写入,但就是不能生成文件

郁闷坏了
回复 支持 反对

使用道具 举报

发表于 2008-6-30 14:42:37 | 显示全部楼层
rra目录下不能生成文件,同时,device下面的设备状态也是down,一直不能up,是不是和rra文件生成有关系
回复 支持 反对

使用道具 举报

发表于 2010-8-30 13:38:19 | 显示全部楼层
我也遇到这个问题,提示类似这样:
  1. RRDTool Says:
  2. ERROR: opening '/var/www/html/cacti/rra/xxxx.rrd': No such file or directory
复制代码
回复 支持 反对

使用道具 举报

发表于 2010-9-30 15:41:50 | 显示全部楼层
rrdtool没装好,看看少了什么
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表