1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE book PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">
3 <chapter id="problems">
10 <pubdate>8 Apr 2003</pubdate>
13 <title>Analyzing and Solving Samba Problems</title>
16 There are many sources of information available in the form
17 of mailing lists, RFCs and documentation. The documentation that comes
18 with the Samba distribution contains good explanations of
19 general SMB topics such as browsing.</para>
22 <title>Diagnostics Tools</title>
24 <para>With SMB networking, it is often not immediately clear what
25 the cause is of a certain problem. Samba itself provides rather
26 useful information, but in some cases you might have to fall back
27 to using a <emphasis>sniffer</emphasis>. A sniffer is a program that
28 listens on your LAN, analyzes the data sent on it and displays it
32 <title>Debugging with Samba Itself</title>
35 One of the best diagnostic tools for debugging problems is Samba itself.
36 You can use the <option>-d option</option> for both &smbd; and &nmbd; to specify the
37 <smbconfoption><name>debug level</name></smbconfoption> at which to run.
38 See the man pages for <command>smbd, nmbd</command> and
39 &smb.conf; for more information regarding debugging options. The debug
40 level can range from 1 (the default) to 10 (100 for debugging passwords).
44 Another helpful method of debugging is to compile Samba using the
45 <command>gcc -g </command> flag. This will include debug information in the binaries and
46 allow you to attach gdb to the running <command>smbd/nmbd</command> process.
47 To attach <command>gdb</command> to an <command>smbd</command>
48 process for an NT workstation, first get the workstation to make the
49 connection. Pressing ctrl-alt-delete and going down to the domain box
50 is sufficient (at least, the first time you join the domain) to
51 generate a <parameter>LsaEnumTrustedDomains</parameter>. Thereafter, the workstation
52 maintains an open connection and there will be an smbd
53 process running (assuming that you haven't set a really short smbd
54 idle timeout). So, in between pressing <command>ctrl-alt-delete</command> and actually
55 typing in your password, you can attach <command>gdb</command> and continue.
59 Some useful Samba commands worth investigating are:
63 &prompt;<userinput>testparm | more</userinput>
64 &prompt;<userinput>smbclient -L //{netbios name of server}</userinput>
70 <title>Tcpdump</title>
73 <ulink url="http://www.tcpdump.org/">Tcpdump</ulink> was the first
74 UNIX sniffer with SMB support. It is a command-line utility and
75 now, its SMB support is somewhat lagging that of <command>ethereal</command>
76 and <command>tethereal</command>.
82 <title>Ethereal</title>
85 <ulink url="http://www.ethereal.com/">Ethereal</ulink> is a graphical
86 sniffer, available for both UNIX (Gtk) and Windows. Ethereal's
87 SMB support is quite good.</para>
89 <para>For details on the use of <command>ethereal</command>, read the well-written
90 Ethereal User Guide.</para>
92 <image id="ethereal1"><imagefile>ethereal1</imagefile><imagedescription>Starting a capture.</imagedescription></image>
94 <para>Listen for data on ports 137, 138, 139, and 445. For example, use
95 the filter <userinput>port 137, port 138, port 139, or port
96 445</userinput> as seen in <link linkend="ethereal1">Starting a capture</link> snapshot.</para>
98 <para>A console version of ethereal is available as well and is called
99 <command>tethereal</command>.</para>
101 <image id="ethereal2"><imagefile>ethereal2</imagefile><imagedescription>Main ethereal data window.</imagedescription></image>
106 <title>The Windows Network Monitor</title>
109 For tracing things on Microsoft Windows NT, Network Monitor
110 (aka Netmon) is available on Microsoft Developer Network CDs,
111 the Windows NT Server install CD and the SMS CDs. The version of
112 Netmon that ships with SMS allows for dumping packets between any two
113 computers (i.e., placing the network interface in promiscuous mode).
114 The version on the NT Server install CD will only allow monitoring
115 of network traffic directed to the local NT box and broadcasts on the
116 local subnet. Be aware that Ethereal can read and write Netmon
121 <title>Installing Network Monitor on an NT Workstation</title>
124 Installing Netmon on an NT workstation requires a couple
125 of steps. The following are instructions for installing Netmon V4.00.349, which comes
126 with Microsoft Windows NT Server 4.0, on Microsoft Windows NT
127 Workstation 4.0. The process should be similar for other versions of
128 Windows NT version of Netmon. You will need both the Microsoft Windows
129 NT Server 4.0 Install CD and the Workstation 4.0 Install CD.
133 Initially you will need to install <application>Network Monitor Tools and Agent</application>
134 on the NT Server to do this:
138 <listitem><para>Go to <guibutton>Start</guibutton> -> <guibutton>Settings</guibutton> -> <guibutton>Control Panel</guibutton> ->
139 <guibutton>Network</guibutton> -> <guibutton>Services</guibutton> -> <guibutton>Add</guibutton>.</para></listitem>
141 <listitem><para>Select the <guilabel>Network Monitor Tools and Agent</guilabel> and click on <guibutton>OK</guibutton>.</para></listitem>
143 <listitem><para>Click on <guibutton>OK</guibutton> on the Network Control Panel.</para></listitem>
145 <listitem><para>Insert the Windows NT Server 4.0 install CD when prompted.</para></listitem>
149 At this point, the Netmon files should exist in <filename>%SYSTEMROOT%\System32\netmon\*.*</filename>.
150 Two subdirectories exist as well, <filename>parsers\</filename> which contains the necessary DLLs
151 for parsing the Netmon packet dump, and <filename>captures\</filename>.
155 To install the Netmon tools on an NT Workstation, you will first need to install the
156 Network Monitor Agent from the Workstation install CD.
160 <listitem><para>Go to <guibutton>Start</guibutton> -> <guibutton>Settings</guibutton> -> <guibutton>Control Panel</guibutton> ->
161 <guibutton>Network</guibutton> -> <guibutton>Services</guibutton> -> <guibutton>Add</guibutton>.</para></listitem>
163 <listitem><para>Select the <guilabel>Network Monitor Agent</guilabel>, click on <guibutton>OK</guibutton>.</para></listitem>
165 <listitem><para>Click on <guibutton>OK</guibutton> in the Network Control Panel.
168 <listitem><para>Insert the Windows NT Workstation 4.0 install CD when prompted.</para></listitem>
172 Now copy the files from the NT Server in <filename>%SYSTEMROOT%\System32\netmon</filename>
173 to <filename>%SYSTEMROOT%\System32\netmon</filename> on the Workstation and set permissions
174 as you deem appropriate for your site. You will need administrative rights on the NT box to run Netmon.
179 <title>Installing Network Monitor on Windows 9x/Me</title>
181 To install Netmon on Windows 9x/Me, install the Network Monitor Agent
182 from the Windows 9x/Me CD (<filename>\admin\nettools\netmon</filename>).
183 There is a readme file located with the Netmon driver files on the CD if you need
184 information on how to do this. Copy the files from a working Netmon installation.
191 <title>Useful URLs</title>
194 <listitem><para>See how Scott Merrill simulates a BDC behavior at
195 <ulink noescape="1" url="http://www.skippy.net/linux/smb-howto.html">
196 http://www.skippy.net/linux/smb-howto.html</ulink>. </para></listitem>
198 <listitem><para>FTP site for older SMB specs:
199 <ulink noescape="1" url="ftp://ftp.microsoft.com/developr/drg/CIFS/">
200 ftp://ftp.microsoft.com/developr/drg/CIFS/</ulink></para></listitem>
207 <title>Getting Mailing List Help</title>
210 There are a number of Samba-related mailing lists. Go to <ulink
211 noescape="1" url="http://samba.org">http://samba.org</ulink>, click on your nearest mirror
212 and then click on <command>Support</command> and next click on <command>
213 Samba-related mailing lists</command>.
217 For questions relating to Samba TNG, go to
218 <ulink noescape="1" url="http://www.samba-tng.org/">http://www.samba-tng.org/.</ulink>
219 It has been requested that you do not post questions about Samba-TNG to the
220 main-stream Samba lists.</para>
223 If you do post a message to one of the lists, please observe the following guidelines :
228 <listitem><para>Always remember that the developers are volunteers, they are
229 not paid and they never guarantee to produce a particular feature at
230 a particular time. Any timelines are <quote>best guess</quote> and nothing more.
233 <listitem><para>Always mention what version of Samba you are using and what
234 operating system it's running under. You should list the relevant sections of
235 your &smb.conf; file, at least the options in <smbconfsection>[global]</smbconfsection>
236 that affect PDC support.
239 <listitem><para>In addition to the version, if you obtained Samba via
240 CVS, mention the date when you last checked it out.</para></listitem>
242 <listitem><para> Try and make your questions clear and brief. Lots of long,
243 convoluted questions get deleted before they are completely read!
244 Do not post HTML encoded messages. Most people on mailing lists simply delete
248 <listitem><para> If you run one of those nifty <quote>I'm on holidays</quote> things when
249 you are away, make sure its configured to not answer mailing list traffic. Auto-responses
250 to mailing lists really irritate the thousands of people who end up having to deal
251 with such bad netiquet bahavior.
254 <listitem><para>Don't cross post. Work out which is the best list to post to
255 and see what happens. Do not post to both samba-ntdom and samba-technical.
256 Many people active on the lists subscribe to more
257 than one list and get annoyed to see the same message two or more times.
258 Often someone will see a message and thinking it would be better dealt
259 with on another list, will forward it on for you.</para></listitem>
261 <listitem><para>You might include <emphasis>partial</emphasis>
262 log files written at a debug level set to as much as 20.
263 Please do not send the entire log but just enough to give the context of the
264 error messages.</para></listitem>
266 <listitem><para>If you have a complete Netmon trace (from the opening of
267 the pipe to the error), you can send the *.CAP file as well.</para></listitem>
269 <listitem><para>Please think carefully before attaching a document to an email.
270 Consider pasting the relevant parts into the body of the message. The Samba
271 mailing lists go to a huge number of people. Do they all need a copy of your
272 &smb.conf; in their attach directory?</para></listitem>
279 <title>How to Get Off the Mailing Lists</title>
281 <para>To have your name removed from a Samba mailing list, go to the same
282 place where you went to
283 subscribe to it. Go to <ulink noescape="1" url="http://lists.samba.org/">http://lists.samba.org</ulink>,
284 click on your nearest mirror, click on <command>Support</command> and
285 then click on<command> Samba related mailing lists</command>.
289 Please do not post messages to the list asking to be removed. You will only
290 be referred to the above address (unless that process failed in some way).