Other Some way to get a list of NFSv4 (TCP) connected clients on a server?

(Other than running a "tcpdump port 2049" and logging all traffic that is).

Ideally would be a sysctl() or something. Since mountd isn't really used for NFSv4 it doesn't seem to keep a list of clients there.

Or some way to get the kernel to say something to some log file when a client connects/disconnects... For us NFSv4/TCP is "good enough", we won't support anything older and UDP won't be supported either...
I only have one client on mine, but this did the job:
# netstat -a | grep nfsd.*ESTABLISHED
tcp4       0      0      apron.926              ESTABLISHED
Might nfsdumpstate -o show what you want?

Hmmm.. Almost. :)

> # nfsdumpstate -o
> Flags OpenOwner Open LockOwner Lock Deleg OldDeleg Clientaddr ClientID
> GSS 0 0 0 0 0 0 4c696e7578204e465376342e312066696c69666a6f6e6b616e2e69742e6c69752e7365

Now I just need to figure out a way to convert that "4c696e7578204e465376342e312066696c69666a6f6e6b616e2e69742e6c69752e7365" into something useful :)

(Like a client IP address)

- Peter
Strange. A Linux client shows up without a Clientaddr, but a FreeBSD client doesn't show up at all when I'm testing now.

A look at the source code for nfsdumpstate also seems to indicate that it only works for IPv4 clients, should be quite easy to fix though - just change the calls to inet_ntoa to use inet_ntop instead (and check for addfam to be anything else than 0). And print a dummy "-" if no addrfam.

But it seems the addrfam fields isn't set at all so that doesn't help anyway... :-/