LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-09-2006, 07:43 PM   #1
tntcoder
Member
 
Registered: Sep 2003
Distribution: Arch
Posts: 89

Rep: Reputation: 15
Samba Logging (File Creation)


Hi,

I am trying to get samba to log file creation and deletion on a share. From what the docs say I need to enable vfs objects = extd_audit, which i have done. This (i think) logs everything into the syslog in /var/syslog.

Is there anyway i can put these specific file change logs into a log file location of my choice, rather than the syslog?

Thanks
Jack
 
Old 09-10-2006, 11:58 AM   #2
amitsharma_26
Member
 
Registered: Sep 2005
Location: New delhi
Distribution: RHEL 3.0/4.0
Posts: 777

Rep: Reputation: 31
Quote:
Originally Posted by www.amitsharma.linuxbloggers.com
Logging in samba

Logs are the best & only way to troubleshoot & monitor samba for any problem & better efficiency.
Logs are all about the communication b/w samba box & clients. More the log level (1-10), more the verbosity. Generally you do not need a log level more than 3, i.e. log / debug level = 3 is ideal in most of scenarios. Debug level more than 3 will generate way too much of detailed & crypt information, which generally suits the need of developers.

[global]
....
log level = 3
log file = <absolute-path-of-any-share\samba.log.%m
If you want your logs to be stored seperately for every client BOX or user samba.log.%u to generate logs on user basis.

Max log size = 50
50 means 50 KB. As soon as your file samba.log.%m crosses 50 KB size, existing file is renamed as samba.log.%m.old & log is being appended to a new samba.log.%m file.

debug time stamp = yes
For system logger, you should compile samba as ./configure --with-syslog & in smb.conf

syslog = 1-10
Default is 1.

Syslog only = Yes/No
I hope this will help you..
 
Old 12-14-2006, 05:21 PM   #3
tbeehler
Member
 
Registered: Aug 2003
Location: Washington State, USA
Distribution: Mainly RH 9.0
Posts: 227

Rep: Reputation: 30
Quote:
Originally Posted by tntcoder
Hi,

I am trying to get samba to log file creation and deletion on a share. From what the docs say I need to enable vfs objects = extd_audit, which i have done. This (i think) logs everything into the syslog in /var/syslog.

Is there anyway i can put these specific file change logs into a log file location of my choice, rather than the syslog?

Thanks
Jack

Greetings Jack!



I had the exact same problem you did, and here's what I did to "fix" it. Please note, I have not gotten around the "log file of my choice" section, but I thought I would offer my thoughts in case they helped you or anyone else.

I added these lines to my global section of my smb.conf file

log level = 0 vfs:2
syslog = 0


and I added these lines to my share section


vfs objects = full_audit
full_auditrefix = %u|%I
full_audit:success = open mkdir rmdir write unlink rename
full_audit:failure = mkdir rmdir write unlink rename

Now you can add various commands to the "prefix, success, and failure" parts. For example, I took a look at the "close" option in the "success" section, but got too many false positives for my tastes. This feature isn't very well documented and I did have to piece together the code from various sources, so the code isn't 100% mine. Once you do those, restart the samba service and then in your syslog file you should get entries like this.

Dec 14 15:18:35 localhost smbd_audit: USERNAME|192.168.0.X|unlink|ok|Share/FOLDER/FILENAME.whatever for when a user manipulates a file or folder.

Hope that helps you or anyone else out!

Travis
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
RPM Spec file creation: %file section question davidas Linux - Newbie 0 03-16-2004 10:36 PM
file creation in C ratheesh Programming 1 01-08-2004 05:39 AM
sychronize samba and unix password at user creation JohanLingen Programming 1 10-10-2003 07:34 PM
Samba user creation with text file Skorpio Linux - Networking 1 10-02-2003 10:05 AM
Samba user creation bripage Linux - General 2 07-26-2002 02:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration