NFSwatch monitoring of an NFS server
nfswatch is an extremely useful tool when you need to understand a server's NFS load. For example, if you want to identify which NFS clients are making heavy I/O traffic to the NFS server.
Download the source RPM from the Fedora build system page nfswatch-4.99.11-11.fc26:
or check for newer packages at https://koji.fedoraproject.org/koji/packageinfo?packageID=2637
Rebuild the package:
rpmbuild --rebuild nfswatch-4.99.11-11.fc26.src.rpm
Install the RPM:
yum install $HOME/rpmbuild/RPMS/x86_64/nfswatch-4.99.11-11.el7.centos.x86_64.rpm
RPM packages for RHEL/CentOS 6 and other OSes can be found in http://rpmfind.net/linux/rpm2html/search.php?query=nfswatch
The EL6 package page is http://rpmfind.net/linux/RPM/dag/redhat/el6/x86_64/nfswatch-4.99.9-1.el6.rf.x86_64.html
See the man nfswatch manual page.
On CentOS 6 and 7 the nfswatch tool spits out lots of error messages:
Unknown Linux fsid_type 6:
It is not obvious which of the file systems the error message refers to.
However, you can still use nfswatch by piping the error messages:
Here is a recommended usage monitoring all network interfaces, listing NFS clients, and sort them by usage:
nfswatch -allif -clients -usage 2>/dev/null
You can also get the usernames of NFS client users:
nfswatch -allif -auth -usage 2>/dev/null
There doesn't seem to be any other tool which provides information similar to nfswatch. However, some insights may be gleaned using these methods:
Use iftop to monitor all traffic on a specific interface, for example:
iftop -i ib0
Analyzing Linux NFS server performance suggests these commands:
netstat -plaute | grep nfs watch -d "netstat -plaute | grep nfs | sort -k 4,5"
I suggest this watch command:
watch -n 5 "netstat -plate | grep nfs | sort -r -n -k 3,2"
- Use the nfsiostat command on each NFS client, see Monitoring Client NFS Storage with nfsiostat.