docs: add "For Netdata running in a Docker container" to go.d/smartcl (#17980)
Ilya Mashchenko committed
Jun 20, 2024 at 23:04 UTC
37133ee0e6fd0a38c8e9c8772d8dc6d6605e9e2b
2 files changed
+28
packaging/docker/README.md
+2
@@ -372,6 +372,8 @@ to Caddyfile.
372
373
### With Docker socket proxy
374
375
+> **Note**: Using Netdata with a Docker socket proxy might have some features not working as expected. It hasn't been fully tested by the Netdata team.
376
+
377
Deploy a Docker socket proxy that accepts and filters out requests using something like
378
[HAProxy](/docs/netdata-agent/configuration/running-the-netdata-agent-behind-a-reverse-proxy/Running-behind-haproxy.md) or
379
[CetusGuard](https://github.com/hectorm/cetusguard) so that it restricts connections to read-only access to
src/go/collectors/go.d.plugin/modules/smartctl/metadata.yaml
+26
@@ -52,6 +52,32 @@ modules:
52
- title: Install smartmontools (v7.0+)
53
description: |
54
Install `smartmontools` version 7.0 or later using your distribution's package manager. Version 7.0 introduced the `--json` output mode, which is required for this collector to function properly.
55
+ - title: For Netdata running in a Docker container
56
+ description: |
57
+ Netdata requires the `SYS_RAWIO` capability and access to the storage devices to run the `smartctl` collector inside a Docker container. Here's how you can achieve this:
58
+
59
+ - `docker run`
60
+
61
+ ```bash
62
+ docker run --cap-add SYS_RAWIO --device /dev/sda:/dev/sda ...
63
+ ```
64
+
65
+ - `docker-compose.yml`
66
+
67
+ ```yaml
68
+ services:
69
+ netdata:
70
+ cap_add:
71
+ - SYS_PTRACE
72
+ - SYS_ADMIN
73
+ - SYS_RAWIO # smartctl
74
+ devices:
75
+ - "/dev/sda:/dev/sda"
76
+ ```
77
+
78
+ > **Multiple Devices**: These examples only show mapping of one device (/dev/sda). You'll need to add additional `--device` options (in docker run) or entries in the `devices` list (in docker-compose.yml) for each storage device you want Netdata's smartctl collector to monitor.
79
+
80
+ > **NVMe Devices**: Do not map NVMe devices using this method. Netdata uses a [dedicated collector](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/nvme#readme) to monitor NVMe devices.
81
configuration:
82
file:
83
name: go.d/smartctl.conf