Home | 简体中文 | 繁体中文 | 杂文 | 打赏(Donations) | ITEYE 博客 | OSChina 博客 | Facebook | Linkedin | 知乎专栏 | Search | Email

32.2. rrdtool demo example

		
rrdtool create datafile.rrd \
	DS:packets:ABSOLUTE:900:0:10000000 \
	RRA:AVERAGE:0.5:1:9600 \
	RRA:AVERAGE:0.5:4:9600 \
	RRA:AVERAGE:0.5:24:6000
		
		
		
rrdtool update datafile.rrd N:100
rrdtool update datafile.rrd N:200
rrdtool update datafile.rrd N:300
		
		

or

		
for (( ; ; )) do
	rrdtool update datafile.rrd N:$( echo `< /dev/urandom tr -dc [:digit:] | head -c 3`)
	sleep 5
done &
		
		
		
rrdtool graph graph.png DEF:pkt=datafile.rrd:packets:AVERAGE \
  LINE1:pkt#ff0000:Packets