Skip to content

Commit 2cbef97

Browse files
Run update.sh
1 parent 6d22c27 commit 2cbef97

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

telegraf/README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,42 @@ Check that the measurement `foo` is added in the DB.
225225

226226
- [Output Plugins](https://docs.influxdata.com/telegraf/latest/plugins/outputs/)
227227

228+
### Monitoring the host filesystem
229+
230+
One of the more common use cases for Telegraf is running it in a container to monitor the host filesystem using the inputs that take information from the `/proc` filesystem. This section only applies to monitoring a Linux host.
231+
232+
To do this, you can mount the host's `/proc` filesystem inside of the container and set the location of `/proc` to an alternate location by using the `HOST_PROC` environment variable to change the location of where `/proc` is located. As an example:
233+
234+
```console
235+
$ docker run -d --name=telegraf \
236+
--net=influxdb \
237+
-e HOST_PROC=/host/proc \
238+
-v /proc:/host/proc:ro \
239+
-v $PWD/telegraf.conf:/etc/telegraf/telegraf.conf:ro \
240+
telegraf
241+
```
242+
243+
### Monitoring docker containers
244+
245+
To monitor other docker containers, you can use the docker plugin and mount the docker socket into the container. An example configuration is below:
246+
247+
```toml
248+
[[inputs.docker]]
249+
endpoint = "unix:///var/run/docker.sock"
250+
```
251+
252+
Then you can start the telegraf container.
253+
254+
```console
255+
$ docker run -d --name=telegraf \
256+
--net=influxdb \
257+
-v /var/run/docker.sock:/var/run/docker.sock \
258+
-v $PWD/telegraf.conf:/etc/telegraf/telegraf.conf:ro \
259+
telegraf
260+
```
261+
262+
Refer to the docker [plugin documentation](https://github.com/influxdata/telegraf/blob/master/plugins/inputs/docker/README.md) for more information.
263+
228264
# Image Variants
229265

230266
The `telegraf` images come in many flavors, each designed for a specific use case.

0 commit comments

Comments
 (0)