1、检查SNMP是否抓到数据,命令:
# snmpwalk -v2c -c public 192.168.1.1
成功会出现大量的数据。
2、检查需要运行的服务是否启动,或重启试试,要等上五分钟,因默认制图是五分钟一次。
3、检查 */cacti/rra/文件夹下是否有需要监控对象的文件生成。
如果无,请检查rra文件夹属性,有很多朋友是用cacti用户写入的,所以没权限,可以配置777全属性允许写入,以后再优化。
如果有文件,在rra目录下使用
rrdtool fetch localhost_mem_swap_4.rrd AVERAGE
看是否有数据生成,一般cacti安装好后,它会自成生成一个本机的监控,可以利用此做故障排查。
有数据是这样的:
1341478500: 1.8349920000e+06
1341478800: 1.8349920000e+06
1341479100: 1.8349920000e+06
1341479400: 1.8349920000e+06
没有数据是这样的:
1341478500:nan
1341478500:nan
1341478500:nan
这样就知道了rrdtool没有制图。
4、登录cacti后,清除缓存
system utilities -->Rebuild poller cache
5、检查apache错误日志tail /etc/httpd/logs/error.log
[Fri Jul 06 16:32:33 2012] [error] [client 192.168.210.238] PHP Warning: phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Chongqing' for 'CST/8.0/no DST' instead in /var/www/html/index.php on line 2
我的错误就在这里,开始时想了半天,我用的是上海时间,肯定没错啦,所以一直忽视了。结果查看日志后才发现原来有重庆时间,更正后马上出图。
放张图大家看看。