- 论坛徽章:
- 0
|
使用rrdtool绘制流量图:
创建语句是这样:
RRD_CREATE = """/usr/bin/rrdtool create %s \
--step 300 \
--start 1241581653 \
DS:dest:COUNTER:600:U:U \
DS:src:COUNTER:600:U:U \
DS:dropped:COUNTER:600:U:U \
DS:dest2:GAUGE:600:U:U \
DS:src2:GAUGE:600:U:U \
DS:dropped2:GAUGE:600:U:U \
RRA:AVERAGE:0.5:1:600 \
RRA:AVERAGE:0.5:6:600 \
RRA:AVERAGE:0.5:24:600 \
RRA:AVERAGE:0.5:288:800 \
RRA:MAX:0.5:1:600 \
RRA:MAX:0.5:6:600\
RRA:MAX:0.5:24:600\
RRA:MAX:0.5:288:800
"""
提取图形的代码这样:最近一个月的流浪图
/usr/bin/rrdtool graph /usr/home/youhong/logservice/../logservice/static/images/rrd/2.png --start 1241148872 --end 1243740872 -t "10.69.2.177-200905011134--200905311134-43200-avg.png" -w 860 -Y DEF:dsa0=/data0/rrd/10.69.2.177.rrd:dest:AVERAGE DEF:dsb0=/data0/rrd/10.69.2.177.rrd:src:AVERAGE LINE2:dsa0#0000FF:"messages received (destination)\l" LINE2:dsb0#00CCFF:"messages received (source)\l"
现在出现的状况是:周统计图正常,月统计图变异非常厉害,why?
使用:
rrdtool fetch --start 1241148872 --end 1243740872 /data0/rrd/10.69.2.177.d AVERAGE 提取的数据在附件。
由于值比较小,所以生成周图的时候*300
/usr/bin/rrdtool graph /usr/home/youhong/logservice/../logservice/static/images/rrd/1.png --start 1243737252 --end 1243740852 -t "10.69.2.177-200905311034--200905311134-60-avg.png" -w 860 -Y DEF:dsa0=/data0/rrd/10.69.2.177.rrd:dest:AVERAGE DEF:dsb0=/data0/rrd/10.69.2.177.rrd:src:AVERAGE CDEF:dsa1=dsa0,300,* CDEF:dsb1=dsb0,300,* LINE2:dsa1#0000FF:"messages received (destination)\l" LINE2:dsb1#00CCFF:"messages received (source)\l"
[ 本帖最后由 hanyh 于 2009-5-31 12:06 编辑 ] |
|