Monitoring NFS operations with nfswatch


I support a number of NFS clients, and periodically need to see which types of NFS operations are being performed. The nfsstat utility works pretty well for this, but sometimes I want to get a broader view of what is going on. When these situations arise, I like to fire up the nfswatch utility which displays network traffic along with a listing of NFS operations:

$ nfswatch

monty Tue May 12 20:47:21 2009 Elapsed time: 00:01:29
Interval packets: 34 (network) 34 (to host) 0 (dropped)
Total packets: 4482 (network) 4482 (to host) 0 (dropped)
Monitoring packets from interface bge0
int pct total int pct total
NFS3 Read 22 65% 3459 TCP Packets 33 97% 4292
NFS3 Write 5 15% 422 UDP Packets 0 0% 21
NFS Read 0 0% 0 ICMP Packets 1 3% 62
NFS Write 0 0% 0 Routing Control 0 0% 0
NFS Mount 0 0% 0 Addr Resolution 0 0% 107
Port Mapper 0 0% 1 Rev Addr Resol 0 0% 0
RPC Author: Matty
Other RPC Packets 0 0% 0 Other Packets 0 0% 0
22 NFS Procedures
Procedure int pct total completed avg(msec) std dev max resp
ACCESS 4 15% 284
CREATE 0 0% 0
GETATTR 18 67% 2991
LINK 0 0% 0
LOOKUP 0 0% 149
MKDIR 0 0% 0
MKNOD 0 0% 0
NULLPROC 0 0% 0
READ 0 0% 21
READDIR 0 0% 12
READDIRPLUS 0 0% 2
READLINK 0 0% 0
REMOVE 0 0% 0
RENAME 0 0% 0
RMDIR 0 0% 0
SETATTR 5 19% 422
SYMLINK 0 0% 0
nfswatch>

This is an awesome tool, and runs awesome on both Linux and Solaris hosts.

This article was posted by Matty on 2009-06-16 10:09:00 -0400 EDT