rrdtutorial

http://oss.oetiker.ch/rrdtool/tut/rrdtutorial.en.html

RRD: Round Robin Database.

RRDtool originated from MRTG (Multi Router Traffic Grapher). MRTG started as a tiny little script for graphing the use of a university's connection to the Internet.

Terminology:

Please read:
[url]http://bbs.chinaunix.net/forum.php?mod=viewthread&tid=864861&page=1[/url]

DS: data source
step: interval
RRA: round robin archive


Data Types: COUNTER, GAUGE, DERIVE, ABSOLUTE

Example:


rrdtool create all.rrd --start 978300900 \
DS:a:COUNTER:600:U:U \
DS:b:GAUGE:600:U:U \
DS:c:DERIVE:600:U:U \
DS:d:ABSOLUTE:600:U:U \
RRA:AVERAGE:0.5:1:10
rrdtool update all.rrd \
978301200:300:1:600:300 \
978301500:600:3:1200:600 \
978301800:900:5:1800:900 \
978302100:1200:3:2400:1200 \
978302400:1500:1:2400:1500 \
978302700:1800:2:1800:1800 \
978303000:2100:4:0:2100 \
978303300:2400:6:600:2400 \
978303600:2700:4:600:2700 \
978303900:3000:2:1200:3000
rrdtool graph all1.png -s 978300600 -e 978304200 -h 400 \
DEF:linea=all.rrd:a:AVERAGE LINE3:linea#FF0000:"Line A" \
DEF:lineb=all.rrd:b:AVERAGE LINE3:lineb#00FF00:"Line B" \
DEF:linec=all.rrd:c:AVERAGE LINE3:linec#0000FF:"Line C" \
DEF:lined=all.rrd:d:AVERAGE LINE3:lined#000000:"Line D"



[img]http://dl.iteye.com/upload/attachment/0080/3465/a3b13f0f-6b41-3b06-9cdc-7baf3519d2d3.png[/img]


[list]
[*]Line A is a COUNTER type, so it should continuously increment and RRDtool must calculate the differences. Also, RRDtool needs to divide the difference by the amount of time lapsed. This should end up as a straight line at 1 (the deltas are 300, the time is 300).
[*]Line B is of type GAUGE. These are "real" values so they should match what we put in: a sort of a wave.
[*]Line C is of type DERIVE. It should be a counter that can decrease. It does so between 2400 and 0, with 1800 in-between.
[*]Line D is of type ABSOLUTE. This is like counter but it works on values without calculating the difference. The numbers are the same and as you can see (hopefully) this has a different result.
[/list]

This translates in the following values, starting at 23:10 and ending at 00:10 the next day (where "u" means unknown/unplotted):

- Line A: u u 1 1 1 1 1 1 1 1 1 u
- Line B: u 1 3 5 3 1 2 4 6 4 2 u
- Line C: u u 2 2 2 0 -2 -6 2 0 2 u
- Line D: u 1 2 3 4 5 6 7 8 9 10 u
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值