背景:图跑了一个月了,其他图都可以正常显示,但有几张图突然不出图了;
通过RRDTOOL RRD 查看,全部都是NAN;
尝试过的解决办法:
- 重启SNMP ---失败
- Cacti rebuild ---失败
- 网上有人说,删除重建,确实好使,但这几张图是业务的图,不能删掉。
- Check db 表,都OK;
- 网络、系统、瓶颈分析,OK;
终结方案:
- 写脚本定时rrdupdate;
#!/bin/bash Stime=$(date +%s) rrdtool="/usr/local/rrdtool/bin/rrdtool" cacti_dir="/var/www/html/cacti/scripts/" #total firstorder_total_rrd='/var/www/html/cacti/rra/57/1653.rrd' firstorder_total_num=$(/usr/bin/php ${cacti_dir}firstorder_total.php firstorder|awk -F: '{print $NF}') #firstorder_auto firstorder_auto_rrd='/var/www/html/cacti/rra/57/1654.rrd' firstorder_auto_num=$(/usr/bin/php ${cacti_dir}firstorder_auto.php firstorder|awk -F: '{print $NF}') #iphone firstorder_iphone_rrd='/var/www/html/cacti/rra/57/1658.rrd' firstorder_iphone_num=$(/usr/bin/php ${cacti_dir}firstorder_3iphone.php firstorder|awk -F: '{print $NF}') ${rrdtool} update ${firstorder_total_rrd} ${Stime}:$firstorder_total_num ${rrdtool} update ${firstorder_auto_rrd} ${Stime}:$firstorder_auto_num ${rrdtool} update ${firstorder_iphone_rrd} ${Stime}:$firstorder_iphone_num
总结:这个世界很大,可以考虑下其他开源工具了,如 Zabbix logstash,elasticsearch,kibana