Cacti 突然断图,解决办法:

背景:图跑了一个月了,其他图都可以正常显示,但有几张图突然不出图了;

 

通过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 

转载于:https://www.cnblogs.com/marcwang/p/4884730.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值