Home | 簡體中文 | 繁體中文 | 雜文 | 打賞(Donations) | ITEYE 博客 | OSChina 博客 | Facebook | Linkedin | 知乎專欄 | Search | Email

36.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