0
0
Fork 0
mirror of https://github.com/netdata/netdata.git synced 2025-04-06 22:38:55 +00:00

docs: add "For Netdata running in a Docker container" to go.d/smartcl ()

This commit is contained in:
Ilya Mashchenko 2024-06-20 23:04:11 +03:00 committed by GitHub
parent 74d42b50fa
commit 37133ee0e6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 28 additions and 0 deletions
packaging/docker
src/go/collectors/go.d.plugin/modules/smartctl

View file

@ -372,6 +372,8 @@ to Caddyfile.
### With Docker socket proxy
> **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.
Deploy a Docker socket proxy that accepts and filters out requests using something like
[HAProxy](/docs/netdata-agent/configuration/running-the-netdata-agent-behind-a-reverse-proxy/Running-behind-haproxy.md) or
[CetusGuard](https://github.com/hectorm/cetusguard) so that it restricts connections to read-only access to

View file

@ -52,6 +52,32 @@ modules:
- title: Install smartmontools (v7.0+)
description: |
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.
- title: For Netdata running in a Docker container
description: |
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:
- `docker run`
```bash
docker run --cap-add SYS_RAWIO --device /dev/sda:/dev/sda ...
```
- `docker-compose.yml`
```yaml
services:
netdata:
cap_add:
- SYS_PTRACE
- SYS_ADMIN
- SYS_RAWIO # smartctl
devices:
- "/dev/sda:/dev/sda"
```
> **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.
> **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.
configuration:
file:
name: go.d/smartctl.conf