[Samba] Login time logging?
collen at hermanjordan.nl
Wed Feb 11 08:16:22 GMT 2004
hmm.. i just made the utmp (who, last)
it show's the online users, but it doesn't
resolve the ip adress to netbios name.. ??
also (maybe same prob here), when i use /log.%m
the log files appear whith machine names (this is normal)
but it also generate logfile's with ip nr's (eg. log.192.168.2.50)
i use wins en bcast to resolve names..
is there still some bug where hostnames don't resolve correct ??
and how can i make utmp show netbios names ??
Collen Blijenberg (Systeem/Netwerk Beheerder)
Monday, February 2, 2004, 9:16:14 AM, you wrote:
RB> I just tried using the netlogon share to see whether certain machines come
RB> up on the net.
RB> The problem is that only machines that are running Win9x appear, anything
RB> more modern like XP clients do not seem to connect to netlogon? There is
RB> no entry in the log at least.
RB> On Sun, 1 Feb 2004 mamue at lb-bbs1.emd.ni.schule.de wrote:
>> > On Fri, 2004-01-30 at 23:49, Remco Barendse wrote:
>> >> Hi all!
>> >> I need a setup that will log exactly when a user has logged in or out of
>> >> samba.
>> >> Preferably I would like to have a separate list per user, but this can
>> >> also be achieved with grep.
>> >> I found some solutions that rely on login script processing which is
>> >> nice
>> >> if your clients are running Win95/Win98 but for anything else it won't
>> >> work.
>> >> Anybody know of a solution?
>> > Many people enable utmp support on the server for this.
>> I have in [netlogon] a
>> root preexec = /usr/local/samba/bin/netlogon-preexec.sh %u %I %m %T
>> shell-script which does:
>> #1.: user, %u
>> #2.: Client-IP, %I
>> #3.: NetBIOS Machine name, %m
>> #4/5.: Timestamp, %T
>> #6.: Group, %g
>> #4/5 (Timestamp) are no longer used
>> /samba/netlogon/generateLoginBatch $1 $2 $3
>> echo "insert into logins (user, host, ip, date, time) values ('$1', '$3',
>> '$2', curdate(), curtime() );" | /usr/bin/mysql -u mysqlUser sambaLogins
>> Windows does (AFAIK) not have the concept of logout-scripts, so you'll
>> never know when people log out. When I have spare time I sometimes
>> generate a little machine-usage report from that data.
More information about the samba