docs: add "install smartmontools" for Docker netdata (#18175)
Ilya Mashchenko committed
Jul 16, 2024 at 00:02 UTC
4c901c44dd64720638bf4bace9e73a954d43ca08
1 file changed
+24
-18
src/go/plugin/go.d/modules/smartctl/metadata.yaml
+24
-18
@@ -54,30 +54,36 @@ modules:
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:
57
+ 1. **Install smartmontools**.
58
59
- - `docker run`
59
+ Ensure `smartctl` is available in the container by setting the environment variable `NETDATA_EXTRA_DEB_PACKAGES=smartmontools` when starting the container.
60
61
- ```bash
62
- docker run --cap-add SYS_RAWIO --device /dev/sda:/dev/sda ...
63
- ```
61
+ 2. **Provide access to storage devices**.
62
65
- - `docker-compose.yml`
63
+ 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:
64
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
- ```
65
+ - `docker run`
66
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.
67
+ ```bash
68
+ docker run --cap-add SYS_RAWIO --device /dev/sda:/dev/sda ...
69
+ ```
70
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/plugin/go.d/modules/nvme#readme) to monitor NVMe devices.
71
+ - `docker-compose.yml`
72
+
73
+ ```yaml
74
+ services:
75
+ netdata:
76
+ cap_add:
77
+ - SYS_PTRACE
78
+ - SYS_ADMIN
79
+ - SYS_RAWIO # smartctl
80
+ devices:
81
+ - "/dev/sda:/dev/sda"
82
+ ```
83
+
84
+ > **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.
85
+
86
+ > **NVMe Devices**: Do not map NVMe devices using this method. Netdata uses a [dedicated collector](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/nvme#readme) to monitor NVMe devices.
87
configuration:
88
file:
89
name: go.d/smartctl.conf