Nfs – Detect if clients are connected to a network share

network-sharenfssamba

we're running samba and nfs servers on an Ubuntu LTS 04.10 machine. Is there a way detect on the server, whether any client is connected to one of the shares? The clients are Windows 7,Linux or OS X systems.

I would like to know this in order to restart the server without disturbing my users.

Thanks,
Kathrin

Best Answer

You can use smbstatus for the Samba shares . It will print a list of users connected with machine, share, etc...

PID     Username      Group         Machine 

-------------------------------------------------------------------
  870   username1     Domain Users  machine1       (111.11.11.111)

  586   username2     Domain Users  machine2       (111.12.11.112)

With nfs, you can use showmount for a list of machines and mounted shares in the machine:

showmount

Hosts on server.domain.com:

111.11.0.0/16,machine1.domain.com

111.11.0.0/16,machine2.domain.com

111.11.0.0/16,machine3.domain.com

Hope it helps.

Cheers,

Bruno

Related Topic