metadata.yaml 7.7 KB

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