1SMBSTATUS(1) User Commands SMBSTATUS(1)
2
3
4
6 smbstatus - report on current Samba connections
7
9 smbstatus [-p|--processes] [-v|--verbose] [-L|--locks] [-S|--shares]
10 [-N|--notify] [-u|--user=STRING] [-b|--brief] [-P|--profile]
11 [-R|--profile-rates] [-B|--byterange] [-n|--numeric] [-f|--fast]
12 [-j|--json] [--resolve-uids] [-?|--help] [--usage]
13 [-d|--debuglevel=DEBUGLEVEL] [--debug-stdout]
14 [--configfile=CONFIGFILE] [--option=name=value]
15 [-l|--log-basename=LOGFILEBASE] [--leak-report] [--leak-report-full]
16
18 This tool is part of the samba(7) suite.
19
20 smbstatus is a very simple program to list the current Samba
21 connections.
22
24 -P|--profile
25 If samba has been compiled with the profiling option, print only
26 the contents of the profiling shared memory area.
27
28 -R|--profile-rates
29 If samba has been compiled with the profiling option, print the
30 contents of the profiling shared memory area and the call rates.
31
32 -b|--brief
33 gives brief output.
34
35 -v|--verbose
36 gives verbose output.
37
38 -L|--locks
39 causes smbstatus to only list locks.
40
41 -B|--byterange
42 causes smbstatus to include byte range locks.
43
44 -p|--processes
45 print a list of smbd(8) processes and exit. Useful for scripting.
46
47 -S|--shares
48 causes smbstatus to only list shares.
49
50 -N|--notify
51 causes smbstatus to display registered file notifications
52
53 -f|--fast
54 causes smbstatus to not check if the status data is valid by
55 checking if the processes that the status data refer to all still
56 exist. This speeds up execution on busy systems and clusters but
57 might display stale data of processes that died without cleaning up
58 properly.
59
60 -u|--user=<username>
61 selects information relevant to username only.
62
63 -n|--numeric
64 causes smbstatus to display numeric UIDs and GIDs instead of
65 resolving them to names.
66
67 -j|--json
68 Output more detailed information in JSON format instead of human
69 readable. The output has the following format:
70
71 {
72 "timestamp": "2022-04-15T18:25:15.364891+0200",
73 "version": "4.17.0pre1-GIT-a0f12b9c80b",
74 "smb_conf": "/opt/samba/etc/smb.conf",
75 "sessions": {
76 "3639217376": {
77 "session_id": "3639217376",
78 "server_id": {
79 "pid": "69650",
80 "task_id": "0",
81 "vnn": "4294967295",
82 "unique_id": "10756714984493602300"
83 },
84 "uid": 1000,
85 "gid": 1000,
86 "username": "johndoe",
87 "groupname": "johndoe",
88 "remote_machine": "127.0.0.1",
89 "hostname": "ipv4:127.0.0.1:59944",
90 "session_dialect": "SMB3_11",
91 "encryption": {
92 "cipher": "",
93 "degree": "none"
94 },
95 "signing": {
96 "cipher": "AES-128-GMAC",
97 "degree": "partial"
98 }
99 }
100 },
101 "tcons": {
102 "3813255619": {
103 "service": "sharename",
104 "server_id": {
105 "pid": "69650",
106 "task_id": "0",
107 "vnn": "4294967295",
108 "unique_id": "10756714984493602300"
109 },
110 "tcon_id": "3813255619",
111 "session_id": "3639217376",
112 "machine": "127.0.0.1",
113 "connected_at": "2022-04-15T17:30:37+0200",
114 "encryption": {
115 "cipher": "AES-128-GMAC",
116 "degree": "full"
117 },
118 "signing": {
119 "cipher": "",
120 "degree": "none"
121 }
122 }
123 },
124 "open_files": {
125 "/home/johndoe/testfolder/sample": {
126 "service_path": "/home/johndoe/testfolder",
127 "filename": "sample",
128 "fileid": {
129 "devid": 59,
130 "inode": 11404245,
131 "extid": 0
132 },
133 "num_pending_deletes": 0,
134 "opens": {
135 "56839/2": {
136 "server_id": {
137 "pid": "69650",
138 "task_id": "0",
139 "vnn": "4294967295",
140 "unique_id": "10756714984493602300"
141 },
142 "uid": 1000,
143 "share_file_id": 2,
144 "sharemode": {
145 "hex": "0x00000003",
146 "NONE": false,
147 "READ": true,
148 "WRITE": true,
149 "DELETE": false,
150 "text": "RW"
151 },
152 "access_mask": {
153 "hex": "0x00000003",
154 "READ_DATA": true,
155 "WRITE_DATA": true,
156 "APPEND_DATA": false,
157 "READ_EA": false,
158 "WRITE_EA": false,
159 "EXECUTE": false,
160 "READ_ATTRIBUTES": false,
161 "WRITE_ATTRIBUTES": false,
162 "DELETE_CHILD": false,
163 "DELETE": false,
164 "READ_CONTROL": false,
165 "WRITE_DAC": false,
166 "SYNCHRONIZE": false,
167 "ACCESS_SYSTEM_SECURITY": false,
168 "text": "RW"
169 },
170 "caching": {
171 "READ": false,
172 "WRITE": false,
173 "HANDLE": false,
174 "hex": "0x00000000",
175 "text": ""
176 },
177 "oplock": {},
178 "lease": {},
179 "opened_at": "2022-04-15T17:30:38+0200"
180 }
181 }
182 }
183 }
184 }
185
186
187 If oplocks are used:
188
189 "oplock": {
190 "EXCLUSIVE": false,
191 "BATCH": false,
192 "LEVEL_II": true,
193 "LEASE": false,
194 "text": "LEVEL_II"
195 }
196
197
198 If leases are used:
199
200 "lease": {
201 "lease_key": "29316055-f55c-de10-c813-af7bf5a430bb",
202 "hex": "0x00000005",
203 "READ": true,
204 "WRITE": true,
205 "HANDLE": false,
206 "text": "RW"
207 }
208
209
210 With byte-range locks (-B, --byterange):
211
212 "byte_range_locks": {
213 "/home/johndoe/testfolder/sample": {
214 "fileid": {
215 "devid": 59,
216 "inode": 11404245,
217 "extid": 0
218 },
219 "file_name": "sample",
220 "share_path": "/home/johndoe/testfolder",
221 "locks": [
222 {
223 "server_id": {
224 "pid": "69650",
225 "task_id": "0",
226 "vnn": "4294967295",
227 "unique_id": "10756714984493602300"
228 },
229 "type": "R",
230 "flavour": "Posix",
231 "start": 0,
232 "size": 16
233 }
234 ]
235 }
236
237
238 With notifies (-N, --notify):
239
240 "notify": {
241 "77247": {
242 "server_id": {
243 "pid": "69650",
244 "task_id": "0",
245 "vnn": "4294967295",
246 "unique_id": "10756714984493602300"
247 },
248 "path": "/home/johndoe/testfolder/testdir",
249 "filter": 4095,
250 "subdir_filter": 4095,
251 "creation_time": "1970-01-01T01:00:14.326582+01:00"
252 }
253 }
254
255
256 For profiling (-P, --profile):
257
258 {
259 "timestamp": "2022-04-15T18:40:43.112216+0200",
260 "version": "4.17.0pre1-GIT-a0f12b9c80b",
261 "smb_conf": "/opt/samba/etc/smb.conf",
262 "SMBD loop": {
263 "connect": {
264 "count": 2
265 },
266 "disconnect": {
267 "count": 1
268 },
269 ...
270 },
271 "System Calls": {
272 "syscall_opendir": {
273 "count": 0,
274 "time": 0
275 },
276 ...
277 },
278 "ACL Calls": {
279 "get_nt_acl": {
280 "count": 0,
281 "time": 0
282 },
283 ...
284 },
285 "Stat Cache": {
286 "statcache_lookups": {
287 "count": 2
288 },
289 ...
290 },
291 "SMB Calls": {
292 "SMBmkdir": {
293 "count": 0,
294 "time": 0
295 },
296 ...
297 },
298 "Trans2 Calls": {
299 "Trans2_open": {
300 "count": 0,
301 "time": 0
302 },
303 ...
304 },
305 "NT Transact Calls": {
306 "NT_transact_create": {
307 "count": 0,
308 "time": 0
309 },
310 ...
311 },
312 "SMB2 Calls": {
313 "smb2_negprot": {
314 "count": 2,
315 "time": 3060,
316 "idle": 0,
317 "inbytes": 452,
318 "outbytes": 568
319 },
320 ...
321 }
322 }
323
324
325
326 -?|--help
327 Print a summary of command line options.
328
329 --usage
330 Display brief usage message.
331
332 -d|--debuglevel=DEBUGLEVEL
333 level is an integer from 0 to 10. The default value if this
334 parameter is not specified is 1 for client applications.
335
336 The higher this value, the more detail will be logged to the log
337 files about the activities of the server. At level 0, only critical
338 errors and serious warnings will be logged. Level 1 is a reasonable
339 level for day-to-day running - it generates a small amount of
340 information about operations carried out.
341
342 Levels above 1 will generate considerable amounts of log data, and
343 should only be used when investigating a problem. Levels above 3
344 are designed for use only by developers and generate HUGE amounts
345 of log data, most of which is extremely cryptic.
346
347 Note that specifying this parameter here will override the log
348 level parameter in the /etc/samba/smb.conf file.
349
350 --debug-stdout
351 This will redirect debug output to STDOUT. By default all clients
352 are logging to STDERR.
353
354 --configfile=<configuration file>
355 The file specified contains the configuration details required by
356 the client. The information in this file can be general for client
357 and server or only provide client specific like options such as
358 client smb encrypt. See /etc/samba/smb.conf for more information.
359 The default configuration file name is determined at compile time.
360
361 --option=<name>=<value>
362 Set the smb.conf(5) option "<name>" to value "<value>" from the
363 command line. This overrides compiled-in defaults and options read
364 from the configuration file. If a name or a value includes a space,
365 wrap whole --option=name=value into quotes.
366
367 -l|--log-basename=logdirectory
368 Base directory name for log/debug files. The extension ".progname"
369 will be appended (e.g. log.smbclient, log.smbd, etc...). The log
370 file is never removed by the client.
371
372 --leak-report
373 Enable talloc leak reporting on exit.
374
375 --leak-report-full
376 Enable full talloc leak reporting on exit.
377
378 -V|--version
379 Prints the program version number.
380
382 This man page is part of version 4.19.3 of the Samba suite.
383
385 smbd(8) and smb.conf(5).
386
388 The original Samba software and related utilities were created by
389 Andrew Tridgell. Samba is now developed by the Samba Team as an Open
390 Source project similar to the way the Linux kernel is developed.
391
392
393
394Samba 4.19.3 11/27/2023 SMBSTATUS(1)