| 1 | plugin_name: go.d.plugin |
| 2 | modules: |
| 3 | - meta: |
| 4 | id: collector-go.d.plugin-samba |
| 5 | plugin_name: go.d.plugin |
| 6 | module_name: samba |
| 7 | monitored_instance: |
| 8 | name: Samba |
| 9 | link: "https://www.samba.org/samba/" |
| 10 | icon_filename: 'samba.svg' |
| 11 | categories: |
| 12 | - data-collection.storage |
| 13 | keywords: |
| 14 | - samba |
| 15 | - smb |
| 16 | - file sharing |
| 17 | related_resources: |
| 18 | integrations: |
| 19 | list: [] |
| 20 | info_provided_to_referring_integrations: |
| 21 | description: "" |
| 22 | overview: |
| 23 | data_collection: |
| 24 | metrics_description: > |
| 25 | This collector monitors Samba syscalls and SMB2 calls. |
| 26 | It relies on the [`smbstatus`](https://www.samba.org/samba/docs/current/man-html/smbstatus.1.html) CLI tool but avoids directly executing the binary. |
| 27 | Instead, it utilizes `ndsudo`, a Netdata helper specifically designed to run privileged commands securely within the Netdata environment. |
| 28 | This approach eliminates the need to use `sudo`, improving security and potentially simplifying permission management. |
| 29 | |
| 30 | Executed commands: |
| 31 | |
| 32 | - `smbstatus -P` |
| 33 | method_description: "" |
| 34 | supported_platforms: |
| 35 | include: [] |
| 36 | exclude: [] |
| 37 | multi_instance: false |
| 38 | additional_permissions: |
| 39 | description: "" |
| 40 | default_behavior: |
| 41 | auto_detection: |
| 42 | description: "" |
| 43 | limits: |
| 44 | description: "" |
| 45 | performance_impact: |
| 46 | description: "" |
| 47 | setup: |
| 48 | prerequisites: |
| 49 | list: |
| 50 | - title: "Verifying and Enabling Profiling for SMBd" |
| 51 | description: | |
| 52 | 1. **Check for Profiling Support** |
| 53 | |
| 54 | Before enabling profiling, it's important to verify if `smbd` was compiled with profiling capabilities. Run the following command as root user (using `sudo`) to check: |
| 55 | |
| 56 | ```bash |
| 57 | $ sudo smbd --build-options | grep WITH_PROFILE |
| 58 | WITH_PROFILE |
| 59 | ``` |
| 60 | |
| 61 | If the command outputs `WITH_PROFILE`, profiling is supported. If not, you'll need to recompile `smbd` with profiling enabled (refer to Samba documentation for specific instructions). |
| 62 | |
| 63 | 2. **Enable Profiling** |
| 64 | |
| 65 | Once you've confirmed profiling support, you can enable it using one of the following methods: |
| 66 | |
| 67 | - **Command-Line Option** |
| 68 | Start smbd with the `-P 1` option when invoking it directly from the command line. |
| 69 | - **Configuration File** |
| 70 | Modify the `smb.conf` configuration file located at `/etc/samba/smb.conf` (the path might vary slightly depending on your system). Add the following line to the `[global]` section: |
| 71 | |
| 72 | ```bash |
| 73 | smbd profiling level = count |
| 74 | ``` |
| 75 | 3. **Restart the Samba service** |
| 76 | configuration: |
| 77 | file: |
| 78 | name: go.d/samba.conf |
| 79 | options: |
| 80 | description: | |
| 81 | The following options can be defined globally: update_every. |
| 82 | folding: |
| 83 | title: Config options |
| 84 | enabled: true |
| 85 | list: |
| 86 | - name: update_every |
| 87 | description: Data collection frequency. |
| 88 | default_value: 10 |
| 89 | required: false |
| 90 | - name: timeout |
| 91 | description: smbstatus binary execution timeout. |
| 92 | default_value: 2 |
| 93 | required: false |
| 94 | examples: |
| 95 | folding: |
| 96 | title: Config |
| 97 | enabled: true |
| 98 | list: |
| 99 | - name: Custom update_every |
| 100 | description: Allows you to override the default data collection interval. |
| 101 | config: | |
| 102 | jobs: |
| 103 | - name: samba |
| 104 | update_every: 5 # Collect statistics every 5 seconds |
| 105 | troubleshooting: |
| 106 | problems: |
| 107 | list: [] |
| 108 | alerts: [] |
| 109 | metrics: |
| 110 | folding: |
| 111 | title: Metrics |
| 112 | enabled: false |
| 113 | description: "" |
| 114 | availability: [] |
| 115 | scopes: |
| 116 | - name: syscall |
| 117 | description: These metrics refer to the the Syscall. |
| 118 | labels: |
| 119 | - name: syscall |
| 120 | description: Syscall name |
| 121 | metrics: |
| 122 | - name: samba.syscall_calls |
| 123 | description: Syscalls Count |
| 124 | unit: calls/s |
| 125 | chart_type: line |
| 126 | dimensions: |
| 127 | - name: syscalls |
| 128 | - name: samba.syscall_transferred_data |
| 129 | description: Syscalls Transferred Data |
| 130 | unit: bytes/s |
| 131 | chart_type: area |
| 132 | dimensions: |
| 133 | - name: transferred |
| 134 | - name: smb2call |
| 135 | description: These metrics refer to the the SMB2 Call. |
| 136 | labels: |
| 137 | - name: smb2call |
| 138 | description: SMB2 call name |
| 139 | metrics: |
| 140 | - name: samba.smb2_call_calls |
| 141 | description: SMB2 Calls Count |
| 142 | unit: calls/s |
| 143 | chart_type: line |
| 144 | dimensions: |
| 145 | - name: smb2 |
| 146 | - name: samba.smb2_call_transferred_data |
| 147 | description: SMB2 Call Transferred Data |
| 148 | unit: bytes/s |
| 149 | chart_type: area |
| 150 | dimensions: |
| 151 | - name: in |
| 152 | - name: out |