Cacti NAN Debug Step

1470阅读 0评论2014-07-14 ehlopxp
分类:LINUX

Cacti Debug
官方:
来源:http://hi.baidu.com/canoeist2002/blog/item/6eb612ef237d92eccf1b3e02.html
使用Cacti一段时间,NAN问题是最常见和最令人头痛不已的。还好上面有解决它的步骤,bugs.cacti.net上面也有很多。我是这么做的,最常用的就是第1个了:
1. Check Cacti Log File
检查Log文件,这可是最常用的一步了,文件在/log/cacti.log,Host后面的数字可以在Devices里面点SNMP Agent之后在URL的最后看到,常见的Log错误:

CACTID: Host[...] DS[....] WARNING: SNMP timeout detected [500 ms], ignoring host '........'
这个是说SNMP超时,可以更改Settings->Poller的时间来解决

CACTID: Poller [...] Host[...] WARNING: Recache Event Detected for Host
如果老出现的知,在System Utilities->Rebuild Poller Cache里面重建下poller,或用 php rebuild_poller_cache.php 命令也一样

CACTID: Poller [...] Host[...] WARNING: Result from SNMP not valid. Partial Result: No Such Object avail
你的SNMP Agent不支持该类型的OID类型
2. Check Basic Data Gathering
这个好办,测试一下数据是否能够正常得到,SNMP Agent代理是否工作正常,OID是否能够或允许访问到,用SNMP命令
snmpwald -v 2c -c public target-host system
3. Check cacti's poller
用cmd.php来检查具体的SNMP Agent是否正常
php -q cmd.php
4. Check MySQL updating
这个我没有用过
5. Check rrd file updating
rrdtool update --template ...
6. Check rrd file ownership
这个简单,看各RRD文件的访问权限是否设置正确
7. Check rrd file numbers
用命令看看具体的RRD文件里面的数据是不是正常的,如果是NAN,返回上面具体检查
rrdtool fetch AVERAGE
You're perhaps wondering about this step, if the former was ok. But due to data sources MINIMUM and MAXIMUM definitions, it is possible, that valid updates for rrd files are suppressed, because MINIMUM was not reached or MAXIMUM was exceeded.
Assuming, you've got some valid rrdtool update in step 3, perform a
rrdtool fetch AVERAGE

and look at the last 10-20 lines. If you find NaN's there, perform
rrdtool info

and check the ds[...].min and ds[...].max entries, e.g.
ds[loss].min = 0.0000000000e+00ds[loss].max = 1.0000000000e+02

In this example, MINIMUM = 0 and MAXIMUM = 100. For a ds.[...].type=GAUGE verify, that e.g. the number returned by the script does not exceed ds[...].MAX (same holds for MINIMUM, respectively).
If you run into this, please do not only update the data source definition within the Data Template, but perform a
rrdtool tune --maximum :

8. Check rrdtool graph statement
打开Graph Management里面具体的SNMP Agent,并且打开Debug功能,具体看DEF的状态,它们指向具体的RRD文件
9. Miscellaneous
如果MySQL数据库里面记录的数据是否过大,如果过大可以Cacti里面的Memory setting,默认是8M.
10. RPM Installation?
看看RPM是否安装完整
11. Not NaN, but 0 (zero) values?
cacti解决取值为nan的一个例子
我建了一个取netscaler服务器和客户端连接数的脚本:
#!/bin/sh

ns1_srvconn=`snmpwalk -v 2c -c public 10.60.0.1 1.3.6.1.4.1.5951.4.1.1.46.1 | awk '{print $4}'`
ns1_cliconn=`snmpwalk -v 2c -c public 10.60.0.1 1.3.6.1.4.1.5951.4.1.1.46.2 | awk '{print $4}'`
echo "CLICONN:$ns1_cliconn SRVCONN:$ns1_srvconn"
并建了相应的Data Input Methods”、"Data Sources"和图形,但是图上数据始终为nan,
debug如下:
rrdtool fetch AVERAGE
看是否取到的值为nan
如果为nan,查看:
rrdtool info
ds[...].min = 0.0000000000e+00
ds[...].max = 1.0000000000e+02
对于ds.[...].type=GAUGE,最大值不能超过ds[...].max,最小值不能低于ds[...].min
结果发现:
最大值为100,在cacti的界面中修改最大值没有生效,于是使用命令强制设置该数据源的最大值:
rrdtool tune nsl2-srvconn_1666.rrd --maximum NSL2-CLICONN:NaN
为无限制。

来源:http://blog.chinaunix.net/u/12479/showart_695751.html
cacti 出图但是显示nan解决方法
http://baikgd.blog.163.com/blog/static/354024952010321102159780/
 

官方:

上一篇:IBM、HP、DELL 服务器配置RAID
下一篇:[HowTo]cacti 0.8.8a安装记录