Koozali.org: home of the SME Server

Contrib for viewing which users are accessing which files?

wingman

Contrib for viewing which users are accessing which files?
« on: December 22, 2004, 10:13:20 PM »
Does anyone know of a contrib that will allow me to see which files are being accessed by which users? I need something similar to the utility in Windows that will give me the file name and user name, preferably sorted by user.

Thanks

mbachmann

Contrib for viewing which users are accessing which files?
« Reply #1 on: December 23, 2004, 08:33:13 AM »
No contrib which will do that but the console command
Code: [Select]
lsof will do what you desire if you hit the right switches.

wingman

Contrib for viewing which users are accessing which files?
« Reply #2 on: December 23, 2004, 02:43:49 PM »
Thanks for your response. This would work, except that for any file within a folder shared to everyone on my network, it shows that the user "root" has them open, not the actual user who is using that file.
I have read up on all the switches, and don't see what I am doing wrong.
I am using this command:
lsof +D /home/e-smith/files/ibays/<shared folder name>, which causes lsof to traverse the named folder and all subfolders and files. Just what I want it to do, but I need to know who is actually accessing the file...and it isn't root, which is what lsof returns.
Any other ideas?

Thanks
Joe Burkhead

Anonymous

Contrib for viewing which users are accessing which files?
« Reply #3 on: December 23, 2004, 02:49:22 PM »
I'm sure there is a better solution but as a last resort you could look at the logs to see when someone was logged on and the files that were accessed at that time. :-o

wingman

Contrib for viewing which users are accessing which files?
« Reply #4 on: December 23, 2004, 02:57:55 PM »
Thanks, but that isn't why I need to see who has the file in use. I need it in real-time. In our office (we prepare income tax returns) I need to be able to easily and quickly see who is in the program when we need to apply an update so that I can make sure that they are all out of it before proceeding with the update. We have a rather large office, and going around and physically checking is not a good option.

Joe

Anonymous

Contrib for viewing which users are accessing which files?
« Reply #5 on: December 23, 2004, 03:31:44 PM »
Quote from: "wingman"
... I need to be able to easily and quickly see who is in the program  ...  make sure that they are all out of it  ... large office, and going around and physically checking is not a good option.
Joe


Do you have an IM system?  You can broadcast a message telling everyone to close the program.

wingman

Contrib for viewing which users are accessing which files?
« Reply #6 on: December 23, 2004, 03:54:10 PM »
.....and if someone is not in their office at the time? Then the program is still open on their machine, and the updates cannot be applied.

Please don't flame me, but this is soooo easy to see on a Windows server. Isn't there a way on SME??

Joe

Offline mdo

  • *
  • 355
  • +0/-0
Contrib for viewing which users are accessing which files?
« Reply #7 on: December 23, 2004, 06:55:32 PM »
Try "smbstatus" on the server console (or through putty), maybe that's what you want?

Regards,
Michael
...

wingman

Contrib for viewing which users are accessing which files?
« Reply #8 on: December 23, 2004, 07:19:47 PM »
Thanks, Michael. That will give me what I need!

I just love SME. Wish I knew as much as some of you gurus!

Joe