1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE refentry PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">
3 <refentry id="smbstatus.1">
6 <refentrytitle>smbstatus</refentrytitle>
7 <manvolnum>1</manvolnum>
8 <refmiscinfo class="source">Samba</refmiscinfo>
9 <refmiscinfo class="manual">User Commands</refmiscinfo>
10 <refmiscinfo class="version">&doc.version;</refmiscinfo>
15 <refname>smbstatus</refname>
16 <refpurpose>report on current Samba connections</refpurpose>
21 <command>smbstatus</command>
22 <arg choice="opt">-p|--processes</arg>
23 <arg choice="opt">-v|--verbose</arg>
24 <arg choice="opt">-L|--locks</arg>
25 <arg choice="opt">-S|--shares</arg>
26 <arg choice="opt">-N|--notify</arg>
27 <arg choice="opt">-u|--user=STRING</arg>
28 <arg choice="opt">-b|--brief</arg>
29 <arg choice="opt">-P|--profile</arg>
30 <arg choice="opt">-R|--profile-rates</arg>
31 <arg choice="opt">-B|--byterange</arg>
32 <arg choice="opt">-n|--numeric</arg>
33 <arg choice="opt">-f|--fast</arg>
34 <arg choice="opt">-j|--json</arg>
35 <arg choice="opt">--resolve-uids</arg>
36 <arg choice="opt">-?|--help</arg>
37 <arg choice="opt">--usage</arg>
38 <arg choice="opt">-d|--debuglevel=DEBUGLEVEL</arg>
39 <arg choice="opt">--debug-stdout</arg>
40 <arg choice="opt">--configfile=CONFIGFILE</arg>
41 <arg choice="opt">--option=name=value</arg>
42 <arg choice="opt">-l|--log-basename=LOGFILEBASE</arg>
43 <arg choice="opt">--leak-report</arg>
44 <arg choice="opt">--leak-report-full</arg>
49 <title>DESCRIPTION</title>
51 <para>This tool is part of the <citerefentry><refentrytitle>samba</refentrytitle>
52 <manvolnum>7</manvolnum></citerefentry> suite.</para>
54 <para><command>smbstatus</command> is a very simple program to
55 list the current Samba connections.</para>
59 <title>OPTIONS</title>
63 <term>-P|--profile</term>
64 <listitem><para>If samba has been compiled with the
65 profiling option, print only the contents of the profiling
66 shared memory area.</para></listitem>
70 <term>-R|--profile-rates</term>
71 <listitem><para>If samba has been compiled with the
72 profiling option, print the contents of the profiling
73 shared memory area and the call rates.</para></listitem>
77 <term>-b|--brief</term>
78 <listitem><para>gives brief output.</para></listitem>
82 <term>-v|--verbose</term>
83 <listitem><para>gives verbose output.</para></listitem>
87 <term>-L|--locks</term>
88 <listitem><para>causes smbstatus to only list locks.</para>
93 <term>-B|--byterange</term>
94 <listitem><para>causes smbstatus to include byte range locks.
99 <term>-p|--processes</term>
100 <listitem><para>print a list of <citerefentry><refentrytitle>smbd</refentrytitle>
101 <manvolnum>8</manvolnum></citerefentry> processes and exit.
102 Useful for scripting.</para></listitem>
106 <term>-S|--shares</term>
107 <listitem><para>causes smbstatus to only list shares.</para>
112 <term>-N|--notify</term>
113 <listitem><para>causes smbstatus to display registered file
119 <term>-f|--fast</term>
120 <listitem><para>causes smbstatus to not check if the status data
121 is valid by checking if the processes that the status data refer to all still
122 exist. This speeds up execution on busy systems and clusters but
123 might display stale data of processes that died without cleaning up properly.</para>
128 <term>-u|--user=<username></term>
129 <listitem><para>selects information relevant to <parameter>username</parameter> only.</para>
134 <term>-n|--numeric</term>
135 <listitem><para>causes smbstatus to display numeric UIDs and GIDs instead of
136 resolving them to names.</para>
141 <term>-j|--json</term>
142 <listitem><para>Output more detailed information in JSON format instead
144 The output has the following format:
147 "timestamp": "2022-04-15T18:25:15.364891+0200",
148 "version": "4.17.0pre1-GIT-a0f12b9c80b",
149 "smb_conf": "/opt/samba/etc/smb.conf",
152 "session_id": "3639217376",
157 "unique_id": "10756714984493602300"
161 "username": "johndoe",
162 "groupname": "johndoe",
163 "remote_machine": "127.0.0.1",
164 "hostname": "ipv4:127.0.0.1:59944",
165 "session_dialect": "SMB3_11",
171 "cipher": "AES-128-GMAC",
178 "service": "sharename",
183 "unique_id": "10756714984493602300"
185 "tcon_id": "3813255619",
186 "session_id": "3639217376",
187 "machine": "127.0.0.1",
188 "connected_at": "2022-04-15T17:30:37+0200",
190 "cipher": "AES-128-GMAC",
200 "/home/johndoe/testfolder/sample": {
201 "service_path": "/home/johndoe/testfolder",
202 "filename": "sample",
208 "num_pending_deletes": 0,
215 "unique_id": "10756714984493602300"
231 "APPEND_DATA": false,
235 "READ_ATTRIBUTES": false,
236 "WRITE_ATTRIBUTES": false,
237 "DELETE_CHILD": false,
239 "READ_CONTROL": false,
241 "SYNCHRONIZE": false,
242 "ACCESS_SYSTEM_SECURITY": false,
254 "opened_at": "2022-04-15T17:30:38+0200"
260 </programlisting> </para>
262 <para>If oplocks are used:
271 </programlisting> </para>
273 <para>If leases are used:
277 "lease_key": "29316055-f55c-de10-c813-af7bf5a430bb",
284 </programlisting> </para>
286 <para>With byte-range locks (-B, --byterange):
288 "byte_range_locks": {
289 "/home/johndoe/testfolder/sample": {
295 "file_name": "sample",
296 "share_path": "/home/johndoe/testfolder",
303 "unique_id": "10756714984493602300"
312 </programlisting> </para>
314 <para> With notifies (-N, --notify):
322 "unique_id": "10756714984493602300"
324 "path": "/home/johndoe/testfolder/testdir",
326 "subdir_filter": 4095,
327 "creation_time": "1970-01-01T01:00:14.326582+01:00"
330 </programlisting> </para>
332 <para> For profiling (-P, --profile):
335 "timestamp": "2022-04-15T18:40:43.112216+0200",
336 "version": "4.17.0pre1-GIT-a0f12b9c80b",
337 "smb_conf": "/opt/samba/etc/smb.conf",
362 "statcache_lookups": {
381 "NT Transact Calls": {
382 "NT_transact_create": {
399 </programlisting> </para>
404 &cmdline.common.samba.client;
409 <title>VERSION</title>
411 <para>This man page is part of version &doc.version; of
412 the Samba suite.</para>
416 <title>SEE ALSO</title>
417 <para><citerefentry><refentrytitle>smbd</refentrytitle>
418 <manvolnum>8</manvolnum></citerefentry> and <citerefentry><refentrytitle>smb.conf</refentrytitle>
419 <manvolnum>5</manvolnum></citerefentry>.</para>
423 <title>AUTHOR</title>
425 <para>The original Samba software and related utilities
426 were created by Andrew Tridgell. Samba is now developed
427 by the Samba Team as an Open Source project similar
428 to the way the Linux kernel is developed.</para>