Monitoring FreeNAS server usage by files,I/O and users

Status
Not open for further replies.

mosh

Explorer
Joined
Mar 23, 2017
Messages
54
Hey,
I'd like to be able to know a few things when using FreeNAS NFS server
1. Find which files are being accessed
2. Find out I/O per user (top-hitter)

What would be the best way to achieve this data?

- Moshe
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
From what I can find out there (I'm curious how to do what you're asking and did some searching), it seems the DTrace tools from Brendan Gregg is what you will need.

It seems the iosnoop and iotop tool and the rwsnoop and rwtop tools will be the ones that get you the data you want with UID being the user... not sure if you will find that the SMB service is instead running as root and you don't get any other UID than 0 in that case though...
 
Joined
Dec 29, 2014
Messages
1,135
This could work lsof | egrep '^COMMAND|/mnt'

I am using the grep for /mnt to exclude system files. This is also assuming all your user files are under /mnt. Here is what it looks like on my system.

Code:
root@freenas2:/usr/bin # lsof | egrep '^COMMAND|/mnt'
lsof: WARNING: compiled for FreeBSD release 11.0-RELEASE; this is 11.1-STABLE.
COMMAND	 PID	   USER   FD	 TYPE			 DEVICE		   SIZE/OFF   NODE NAME
smbd	  27886	   root  cwd	 VDIR	  50,2357723187				  4	  4 /mnt/RAIDZ2-I/CIFS-I
smbd	  27886	   root   32r	VDIR	  50,2357723187				  4	  4 /mnt/RAIDZ2-I/CIFS-I
smbd	  27886	   root   33r	VDIR	  50,2357723187				 55	  9 /mnt/RAIDZ2-I/CIFS-I/elliot
smbd	  27886	   root   47r	VDIR	  50,2357723187				  4	  4 /mnt/RAIDZ2-I/CIFS-I


I have windows explorer looking at that particular directory.
 
Status
Not open for further replies.
Top