I've got a directory shared on my network, using Samba. People on the netwerk use this Samba share to download files from my share to their computers. I'm interested in what files are downloaded most, and by which users they are downloaded. I'd like to see this in real time, if possible. Is there a program that allows me to do this? If yes, how can I use it?

I'm using Ubuntu 11.10.


You can get Samba to log stuff like that. Check the Samba man pages, via man -k samba. Read man smb.conf and see the sections Log File and Log Level

  • Could you explain in some more detail what I should do exactly? Is it enough to just add log file = ~/samba-log.%m to /etc/samba/smb.conf? – Exeleration-G Dec 21 '11 at 0:09
  • No! The file path you give ~/samba-log.%m uses the "~" shortcut for "my home directory", a meaningless concept to the Samba daemon. Warning: I'm not running Samba on this computer, so I can't test any of this, so YMMV. Have you read the man smb.conf? When I did, it suggested that log file = /var/log/samba/snoop-log.%m and log level = 10 would be a good start. – waltinator Dec 21 '11 at 1:57
  • I did read it, but I found it hard to interpret. You're right about the first poit, though. I want the logs to land in my home directory if possible, so I changed the path to /home/MyName/samba-log.%m. I'll try the line you adviced right now though. – Exeleration-G Dec 21 '11 at 9:31
  • It doesn't seem to work. I've added the following stuff to etc/samba/smb.conf, right under the share: loglevel = 10 # log per machine logfile = /var/log/samba/samba-machinelog.%m #log per user logfile = /var/log/samba/samba-userlog.%u Do you see anything that could be wrong here? – Exeleration-G Dec 22 '11 at 12:39
  • Did you restart samba? Did you run Samba's testparm (after reading the man page)? Yes there is something wrong with what you added to smb.conf! You misspelled several words. "loglevel" should be "log level", "logfile" should be "log file", as shown in man smb.conf. – waltinator Dec 22 '11 at 16:03

just try next :

sudo watch smbstatus

This will continually redisplay a CLI status of SMB connections, like 'top'.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.