Add Samba collector yaml (#15507)
Fotis Voutsas committed
Jul 26, 2023 at 15:21 UTC
db1794b28159616477ecd71cf8a56143114ecfc1
1 file changed
+152
-81
collectors/python.d.plugin/samba/metadata.yaml
+152
-81
@@ -3,52 +3,123 @@ meta:
3
module_name: samba
4
monitored_instance:
5
name: Samba
6
- link: ''
6
+ link: https://www.samba.org/samba/
7
categories:
8
- - data-collection.storage-mount-points-and-filesystems
9
- icon_filename: 'samba.jpg'
8
+ - data-collection.storage-mount-points-and-filesystems
9
+ icon_filename: "samba.jpg"
10
related_resources:
11
integrations:
12
list: []
13
info_provided_to_referring_integrations:
14
- description: ''
15
- keywords: []
14
+ description: ""
15
+ keywords:
16
+ - samba
17
+ - file sharing
18
most_popular: false
19
overview:
20
data_collection:
19
- metrics_description: 'Monitor Samba performance for optimal network file sharing operations. Netdata provides real-time insights and alerts for efficient file sharing.'
20
- method_description: ''
21
+ metrics_description: "This collector monitors the performance metrics of Samba file sharing."
22
+ method_description: |
23
+ It is using the `smbstatus` command-line tool.
24
+
25
+ Executed commands:
26
+
27
+ - `sudo -n smbstatus -P`
28
supported_platforms:
29
include: []
30
exclude: []
24
- multi_instance: true
31
+ multi_instance: false
32
additional_permissions:
26
- description: ''
33
+ description: |
34
+ `smbstatus` is used, which can only be executed by `root`. It uses `sudo` and assumes that it is configured such that the `netdata` user can execute `smbstatus` as root without a password.
35
default_behavior:
36
auto_detection:
29
- description: ''
37
+ description: "After all the permissions are satisfied, the `smbstatus -P` binary is executed."
38
limits:
31
- description: ''
39
+ description: ""
40
performance_impact:
33
- description: ''
41
+ description: ""
42
setup:
43
prerequisites:
36
- list: []
44
+ list:
45
+ - title: Permissions and programs
46
+ description: |
47
+ To run the collector you need:
48
+
49
+ - `smbstatus` program
50
+ - `sudo` program
51
+ - `smbd` must be compiled with profiling enabled
52
+ - `smbd` must be started either with the `-P 1` option or inside `smb.conf` using `smbd profiling level`
53
+
54
+ The module uses `smbstatus`, which can only be executed by `root`. It uses `sudo` and assumes that it is configured such that the `netdata` user can execute `smbstatus` as root without a password.
55
+
56
+ - add to your `/etc/sudoers` file:
57
+
58
+ `which smbstatus` shows the full path to the binary.
59
+
60
+ ```bash
61
+ netdata ALL=(root) NOPASSWD: /path/to/smbstatus
62
+ ```
63
+
64
+ - Reset Netdata's systemd unit [CapabilityBoundingSet](https://www.freedesktop.org/software/systemd/man/systemd.exec.html#Capabilities) (Linux distributions with systemd)
65
+
66
+ The default CapabilityBoundingSet doesn't allow using `sudo`, and is quite strict in general. Resetting is not optimal, but a next-best solution given the inability to execute `smbstatus` using `sudo`.
67
+
68
+
69
+ As the `root` user, do the following:
70
+
71
+ ```cmd
72
+ mkdir /etc/systemd/system/netdata.service.d
73
+ echo -e '[Service]\nCapabilityBoundingSet=~' | tee /etc/systemd/system/netdata.service.d/unset-capability-bounding-set.conf
74
+ systemctl daemon-reload
75
+ systemctl restart netdata.service
76
+ ```
77
configuration:
78
file:
39
- name: ''
40
- description: ''
79
+ name: python.d/samba.conf
80
options:
42
- description: ''
81
+ description: |
82
+ There are 2 sections:
83
+
84
+ * Global variables
85
+ * One or more JOBS that can define multiple different instances to monitor.
86
+
87
+ The following options can be defined globally: priority, penalty, autodetection_retry, update_every, but can also be defined per JOB to override the global values.
88
+
89
+ Additionally, the following collapsed table contains all the options that can be configured inside a JOB definition.
90
+
91
+ Every configuration JOB starts with a `job_name` value which will appear in the dashboard, unless a `name` parameter is specified.
92
folding:
44
- title: ''
93
+ title: "Config options"
94
enabled: true
46
- list: []
95
+ list:
96
+ - name: update_every
97
+ description: Sets the default data collection frequency.
98
+ default_value: 5
99
+ required: false
100
+ - name: priority
101
+ description: Controls the order of charts at the netdata dashboard.
102
+ default_value: 60000
103
+ required: false
104
+ - name: autodetection_retry
105
+ description: Sets the job re-check interval in seconds.
106
+ default_value: 0
107
+ required: false
108
+ - name: penalty
109
+ description: Indicates whether to apply penalty to update_every in case of failures.
110
+ default_value: yes
111
+ required: false
112
examples:
113
folding:
114
enabled: true
50
- title: ''
51
- list: []
115
+ title: "Config"
116
+ list:
117
+ - name: Basic
118
+ description: A basic example configuration.
119
+ config: |
120
+ my_job_name:
121
+ name: my_name
122
+ update_every: 1
123
troubleshooting:
124
problems:
125
list: []
@@ -60,64 +131,64 @@ metrics:
131
description: ""
132
availability: []
133
scopes:
63
- - name: global
64
- description: ""
65
- labels: []
66
- metrics:
67
- - name: syscall.rw
68
- description: R/Ws
69
- unit: "KiB/s"
70
- chart_type: area
71
- dimensions:
72
- - name: sendfile
73
- - name: recvfile
74
- - name: smb2.rw
75
- description: R/Ws
76
- unit: "KiB/s"
77
- chart_type: area
78
- dimensions:
79
- - name: readout
80
- - name: writein
81
- - name: readin
82
- - name: writeout
83
- - name: smb2.create_close
84
- description: Create/Close
85
- unit: "operations/s"
86
- chart_type: line
87
- dimensions:
88
- - name: create
89
- - name: close
90
- - name: smb2.get_set_info
91
- description: Info
92
- unit: "operations/s"
93
- chart_type: line
94
- dimensions:
95
- - name: getinfo
96
- - name: setinfo
97
- - name: smb2.find
98
- description: Find
99
- unit: "operations/s"
100
- chart_type: line
101
- dimensions:
102
- - name: find
103
- - name: smb2.notify
104
- description: Notify
105
- unit: "operations/s"
106
- chart_type: line
107
- dimensions:
108
- - name: notify
109
- - name: smb2.sm_counters
110
- description: Lesser Ops
111
- unit: "count"
112
- chart_type: stacked
113
- dimensions:
114
- - name: tcon
115
- - name: negprot
116
- - name: tdis
117
- - name: cancel
118
- - name: logoff
119
- - name: flush
120
- - name: lock
121
- - name: keepalive
122
- - name: break
123
- - name: sessetup
134
+ - name: global
135
+ description: "These metrics refer to the entire monitored application."
136
+ labels: []
137
+ metrics:
138
+ - name: syscall.rw
139
+ description: R/Ws
140
+ unit: "KiB/s"
141
+ chart_type: area
142
+ dimensions:
143
+ - name: sendfile
144
+ - name: recvfile
145
+ - name: smb2.rw
146
+ description: R/Ws
147
+ unit: "KiB/s"
148
+ chart_type: area
149
+ dimensions:
150
+ - name: readout
151
+ - name: writein
152
+ - name: readin
153
+ - name: writeout
154
+ - name: smb2.create_close
155
+ description: Create/Close
156
+ unit: "operations/s"
157
+ chart_type: line
158
+ dimensions:
159
+ - name: create
160
+ - name: close
161
+ - name: smb2.get_set_info
162
+ description: Info
163
+ unit: "operations/s"
164
+ chart_type: line
165
+ dimensions:
166
+ - name: getinfo
167
+ - name: setinfo
168
+ - name: smb2.find
169
+ description: Find
170
+ unit: "operations/s"
171
+ chart_type: line
172
+ dimensions:
173
+ - name: find
174
+ - name: smb2.notify
175
+ description: Notify
176
+ unit: "operations/s"
177
+ chart_type: line
178
+ dimensions:
179
+ - name: notify
180
+ - name: smb2.sm_counters
181
+ description: Lesser Ops
182
+ unit: "count"
183
+ chart_type: stacked
184
+ dimensions:
185
+ - name: tcon
186
+ - name: negprot
187
+ - name: tdis
188
+ - name: cancel
189
+ - name: logoff
190
+ - name: flush
191
+ - name: lock
192
+ - name: keepalive
193
+ - name: break
194
+ - name: sessetup