@@ -6,8 +6,73 @@ Samba metrics exporter converts 'smbstatus' output into
6
6
7
7
## Build
8
8
9
- ``` bash
9
+ ``` console
10
10
$ make build
11
11
12
12
$ make image-build
13
13
```
14
+
15
+
16
+ ## Query metrics
17
+
18
+ When running (by privileged user) along-side active SMB server, ` smbmetrics `
19
+ exports a set of gauge metrics over HTTP via port ` 8080 ` . Most metrics become
20
+ visible only when active SMB connections exists. Execute the folowing ` curl `
21
+ command on the same machine where you run ` smbmetrics ` instance:
22
+
23
+ ``` console
24
+ $ curl --request GET " http://localhost:8080/metrics"
25
+ ```
26
+
27
+ ## Exported metrics
28
+
29
+ | Metric name | Description |
30
+ | ---------------------------| --------------------------------------------------|
31
+ | ` smb_metrics_status ` | Status and version of running process |
32
+ | ` smb_sessions_total ` | Number of active SMB sessions |
33
+ | ` smb_tcon_total ` | Number of active SMB tree-connections |
34
+ | ` smb_users_total ` | Number of connected users |
35
+ | ` smb_openfiles_total ` | Number of currently open files |
36
+ | ` smb_openfiles_access_rw ` | Open files with ` "RW" ` access-mask set |
37
+ | ` smb_share_activity ` | Number of remote machines using each share |
38
+ | ` smb_share_byremote ` | Number of shares used by each remote machine |
39
+
40
+
41
+
42
+ ## Example
43
+
44
+ The following example is from a setup with 2 shares and 2 users connected and
45
+ performing SMB file-system operations from 4 different machines:
46
+
47
+ ``` console
48
+ $ curl --request GET " http://localhost:8080/metrics"
49
+
50
+ # HELP smb_metrics_status Current metrics-collector status versions
51
+ # TYPE smb_metrics_status gauge
52
+ smb_metrics_status{commitid="092fe2bb0",ctdbvers="4.20.0-103",sambaimage="",sambavers="4.20.0-103",version="v0.2-28-g092fe2b"} 1
53
+ # HELP smb_sessions_total Number of currently active SMB sessions
54
+ # TYPE smb_sessions_total gauge
55
+ smb_sessions_total 8
56
+ # HELP smb_tcon_total Number of currently active SMB tree-connections
57
+ # TYPE smb_tcon_total gauge
58
+ smb_tcon_total 8
59
+ # HELP smb_users_total Number of currently active SMB users
60
+ # TYPE smb_users_total gauge
61
+ smb_users_total 2
62
+ # HELP smb_openfiles_total Number of currently open files
63
+ # TYPE smb_openfiles_total gauge
64
+ smb_openfiles_total 5
65
+ # HELP smb_openfiles_access_rw Number of open files with read-write access mode
66
+ # TYPE smb_openfiles_access_rw gauge
67
+ smb_openfiles_access_rw 4
68
+ # HELP smb_share_activity Number of remote machines currently using a share
69
+ # TYPE smb_share_activity gauge
70
+ smb_share_activity{service="smbshare1"} 4
71
+ smb_share_activity{service="smbshare2"} 2
72
+ # HELP smb_share_for_remote Number of shares served for remote machine
73
+ # TYPE smb_share_for_remote gauge
74
+ smb_share_byremote{machine="192.168.122.71"} 2
75
+ smb_share_byremote{machine="192.168.122.72"} 1
76
+ smb_share_byremote{machine="192.168.122.73"} 2
77
+ smb_share_byremote{machine="192.168.122.74"} 1
78
+ ```
0 commit comments