This little AWK program converts a series of DRBD's
/proc/drbd output into a file that can be loaded into a RRD
database. As a result you can see the throughput of all your ressources over time, how they affected each other, and which syncer
rate combinations are the most effective.
Color improvements welcome ;-)
Download rrddrbd.awk
Usage
- create a RRD database. It needs three GAUGEs for every ressource in /proc/drbd.
These will hold (in order)
- speed
- average
- want (drbdsetup /dev/drbdn syncer -r)
Adapt the --step parameter to the delay in the next command, e.g. 30 seconds.
while :; do date +%s; date; cat /proc/drbd; sleep 30;done | tee drbd.out
run the sync or verify
./rrddrbd.awk drbd.out > awk2rrd.out
while read line; do rrdtool update database.rrd "$line"; done < awk2rrd.out
- use the database to create the graphs.
Example 1 (ressource comparison),
Example 2 (overall throughput)
Pitfalls
You have to "rrdtool create" the database with the
--start parameter.
Otherwise RRD will refuse to fill the database with entries older than the date of creation!