Monitoring disk I/O on FreeBSD

We use FreeBSD for our storage servers. One thing I've noticed is that there doesn't appear to be any way to programmatically get disk I/O statistics on FreeBSD like you can with Linux and others (e.g. /proc/diskstats on Linux). I'm assuming this is why our current monitoring system (CheckMK) doesn't monitor disk I/O on FreeBSD. Looking at moving to Prometheus and its node exporter doesn't support disk stats on FreeBSD either. Does anyone know why this is? I've always been curious about this.

We have had to just live without disk I/O stats on FreeBSD. That said, I've been really thinking about this lately and I think I have a way to use iostat and/or DTrace to get detailed I/O stats into our monitoring system.

How do you monitor disk I/O on FreeBSD?
 
I use iostat. When I was tracking down why my ZFS scrubs were causing the disks to hang, I actually had some scripts ready to go, with just the right parameters, but a moment ago I couldn't find them. I probably stored them in /tmp and called them "monitor.sh" or something dumb like that. The key to iostat is to spend 10 minutes fiddling with options and parameters, until you get the output you want. Or just run it with as much output as possible, and post-process the chatter for the summaries you like.

The other thing is: run "zpool iostat" (typically some variants, like -v) in a loop, and take differences of the numbers (pretty simple in an awk script).
 
Also look if Netdata provides it for FreeBSD.

I actually just installed netdata again and it looks like it does support more advanced disk stats on FreeBSD. The last time I checked it did not. They now have a free cloud component to aggregate all your servers too (though I'm not sure I'm 100% in love with that idea just yet).


Awesome. Just what I was looking for. Thanks!
 
Back
Top