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!
 
I would pay for a command that simply displays any file creation, access or modification anywhere on the entire system instantly, with full pathname. Nothing else. Never noticed such thing in many years FreeBSD. Maybe I just miss it all the time... It would be a very significant problem-finding tool for me. Programs trying to open non-existing things, programs crashing due to lack of write permissions, programs attempting to mess in wrong places....
 
I would pay for a command that simply displays any file creation, access or modification anywhere on the entire system instantly, with full pathname.
Sort of like sysinternal's regmon/diskmon for Windows does?

Not sure, never used it, but I suspect a clever dtrace(1) script could provide that information.
 
Sort of like sysinternal's regmon/diskmon for Windows does?

Not sure, never used it, but I suspect a clever dtrace(1) script could provide that information.
I think it must be an optional filesystem kernel module routine that outputs everything to something. It's getting complicated there. 😆
 
The audit system might be useful too. But that's not something you can simply run to get some stats.
 
Back
Top