[Samba] smbstatus - switched off computers are sometimes showed

Volker Lendecke Volker.Lendecke at SerNet.DE
Sat Sep 20 17:37:55 GMT 2008


On Fri, Sep 19, 2008 at 10:02:02PM +0200, Vlastimil Šetka wrote:
> I have a Samba server configured as PDC for ~100 computers. It's version 
> 3.0.24 running on Debian Etch (distribution package).
> 
> I want to write a tool for user logon/logoff tracking. Because parsing 
> log files is hard job (windows frequently disconnets or connects during 
> user session or etc.) I decide to use smbstatus output which seem to be 
> reliable.
> 
> So I run smbstatus binary every 10 seconds, parse the output and all is 
> fine. But sometimes in the smbstatus output is show computer which is 
> several hours switched off. At the next run (after 10s) this record is 
> not presented. Sometimes this "ghost" record is shown for ~30 seconds.

Does that smbd still exist? If computers are just switched
off then Samba might not notice.

> Example:
> 
> 11:10:21 - MACHINE1/USER1 - is in smbstatus
> ... constantly is in smbstatus
> 12:14:11 - MACHINE1/USER1 - is NOT in smbstatus
> 12:15:21 - MACHINE1/USER2 - is in smbstatus
> ...
> 12:45:31 - MACHINE1/USER2 - is NOT in smbstatus
> Now the MACHINE1 is switched off.
> 18:16:21 - MACHINE1/USER1 - is in smbstatus !! (and the MACHINE1 is 
> switched off several hours!)
> 18:16:31 - MACHINE1/USER1 - is NOT in smbstatus
> 
> Sometimes (cca twice a day) smbstatus return error output like this:
>  tdb(/var/run/samba/sessionid.tdb): rec_read bad magic 0xd9fee666 at 
> offset=116988

This is normal. Smbstatus reads the tdb files in read-only
mode. This implies no locking which in turn might lead to
smbstatus reading an inconsistent tdb file.

Volker
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba/attachments/20080920/3e857c21/attachment.bin


More information about the samba mailing list