provides detailed
information for diagnosis of NFS problems at the protocol level. The
utility is mainly used to monitor NFS
traffic over the network. The
utilities are used to report potential
security problems on NFS servers.
14.4.3. NFSWATCH
NFSWATCH was developed by David Curry of Purdue University
in
the late
1980s, with some improvements to the basic framework provided by Jeff
Mogul of Digital Equipment Corporation (now Compaq). It is mainly
used to monitor NFS activity on a given server, or NFS activity on
the local network. NFSWATCH gathers its data by monitoring the
network interface of the system where it is invoked.
NFSWATCH 4.3 is the most recent version at the time of this writing,
and only supports NFS Version 2 over UDP. You should be aware that at
the time of this writing, a bug in the tool causes NFS Version 3
traffic to the server to incorrectly increment the NFS Version 2
counters. This is due to the fact that the tool does not check the
NFS version number of the packet received.
Regardless of its current limitations, NFSWATCH is still a very
useful tool whose main features are worth mentioning:
-
The tool categorizes the incoming network traffic and continuously
updates the statistics on the display. You can also instruct the tool
to create a more detailed log file of the network traffic.
-
It allows you to log statistics for every NFS operation, for every
exported filesystem, for files for which you specify particular
interest, or for NFS clients that access your server.
-
It reports usage of NFS clients and users of the filesystems.
-
It can be run interactively or remotely (via rsh), or it can be
scheduled to run from cron.
-
Total runtime can be specified for unsupervised traffic monitoring.
NFSWATCH is available at
ftp://gatekeeper.dec.com/pub/net/ip/nfs/nfswatch4.3.tar.gz.
The following example shows a sample log file of an NFSWATCH run on
server
zeus for a period of five seconds:
# NFSwatch log file
# Packets from: all hosts
# Packets to: zeus
#
# begin
#
Date: Tue Aug 1 16:31:22 2000
Cycle Time: 5
Elapsed Time:
#
# total packets network to host dropped
#
Interval Packets: 2371 2371 0
Total Packets: 2371 2371 0
#
# packet counters int pct total
#
ND Read: 0 0% 0
ND Write: 0 0% 0
NFS Read: 166 7% 166
NFS Write: 346 15% 346
NFS Mount: 0 0% 0
YP/NIS/NIS+: 0 0% 0
RPC Authorization: 0 0% 0
Other RPC Packets: 1844 78% 1844
TCP Packets: 2 0% 2
UDP Packets: 2358 99% 2358
ICMP Packets: 1 0% 1
Routing Control: 2 0% 2
Address Resolution: 10 0% 10
Reverse Addr Resol: 0 0% 0
Ethernet/FDDI Bdcst: 13 1% 13
Other Packets: 0 0% 0
#
# nfs counters int pct total
#
/export/home: 512 100% 512 (0/0/5/0/12/0/154/0/
335/2/0/0/0/0/3/1/0/0)
#
# file counters int pct total
#
#
# nfs procs
#
Procedure int pct total completed ave.resp var.resp max.resp
CREATE 2 0% 2
GETATTR 0 0% 0
GETROOT 0 0% 0
LINK 0 0% 0
LOOKUP 12 2% 12
MKDIR 3 1% 3
NULLPROC 0 0% 0
READ 154 30% 154
READDIR 0 0% 0
READLINK 0 0% 0
REMOVE 0 0% 0
RENAME 0 0% 0
RMDIR 1 0% 1
SETATTR 5 1% 5
STATFS 0 0% 0
SYMLINK 0 0% 0
WCACHE 0 0% 0
WRITE 335 65% 335
The NFSWATCH log shows the distribution of NFS READ, NFS WRITE, NFS
MOUNT, NIS, and RPC AUTHORIZATION packets among others. The NFS
counters section indicates the total number NFS operations per
filesystem exported (one in this case) during the interval. The
operation distribution denoted by
(0/0/5/0/12/0/154/0/335/2/0/0/0/0/3/1/0/0)
indicates that the majority of the operations occurred in the middle
of the interval. The
packet counters and
nfs procs indicate that there were close to
twice as many writes as reads. The low lookup count leads us to
believe that
most writes occurred to the same file.