Introduction
We are going to log, every five seconds, the RTT values obtained from doing a ping to two different IP addresses.
Create the database
If we do not obtain a value in 10 seconds that value is lost.
The expected values are between 20.000 and 80.000 milliseconds.
We log data every 1 sample.
We store 120960 samples (one week).
Each sample is taken every 5 seconds.
12 samples x 5 seconds/sample = 60 seconds = 1 minute
12 samples x 60m x 24h x 7d = 120960 samples
# rrdtool create rtt.rrd \
> -s 5 \
> DS:google:GAUGE:10:20.000:80.000 \
> DS:yahoo:GAUGE:10:20.000:80.000 \
> RRA:AVERAGE:0.5:1:120960 \
> RRA:MIN:0.5:1:120960 \
> RRA:MAX:0.5:1:120960
Obtain the RTT values
# cat rtt.sh
# watch -n 5 ./rtt.sh 216.239.32.10 68.180.131.16
Check stored values
# rrdtool fetch rtt.rrd AVERAGE | grep -v nan
Analyze the graph
# cat make_graph.sh
# ./make_graph.sh && eog rtt.png
References
# man rrdtool rrdcreate rrdupdate rrdfetch rrdlast rrdgraph
No comments:
Post a Comment