You will need to expose the necessary dirs/files/sockets to the Telegraf
container so that it can collect stats from the host machine. Here is what
I was able to find:

```
docker run \
  -v /sys:/rootfs/sys:ro \
  -v /proc:/rootfs/proc:ro \
  -v /var/run/docker.sock:/var/run/docker.sock:ro \
  -v /var/run/utmp:/var/run/utmp:ro \
  telegraf
```

Though the exact files may depend on your OS, distribution, and/or version.

On Thu, Dec 1, 2016 at 7:36 AM, jiaqing.chen <[email protected]>
wrote:

> *description*
>
> Now telegraf is running inside docker.I set input config to collect net,
> processor measurements, but the net and processors measurements collected
> is the docker container’s measurements which run telegraf. In fact, my mind
> is to collect that measurements on the host which the telegraf docker is
> running on.How can I fix it?
>
> *my telegraf input conf*
>
> # Get the number of processes and group them by status
>
> [[inputs.processes]]
>
>   # no configuration
>
>
>
> # Read metrics about swap memory usage
>
> [[inputs.swap]]
>
>   # no configuration
>
>
>
> # Read metrics about system load & uptime
>
> [[inputs.system]]
>
>   # no configuration
>
>
>
> # Read metrics about network interface usage
>
> [[inputs.net]]
>
>   ## By default, telegraf gathers stats from any up interface (excluding
> loopback)
>
>   ## Setting interfaces will tell it to gather these explicit interfaces,
>
>   ## regardless of status.
>
>   ##
>
>   interfaces = ["eth0", "eth1"]
>
> --
> Remember to include the version number!
> ---
> You received this message because you are subscribed to the Google Groups
> "InfluxData" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/influxdb.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/influxdb/tencent_702DA616D5F90137E11AC2C9%40qq.com
> <https://groups.google.com/d/msgid/influxdb/tencent_702DA616D5F90137E11AC2C9%40qq.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Remember to include the version number!
--- 
You received this message because you are subscribed to the Google Groups 
"InfluxData" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/influxdb/CAD8sRLAjvs7CrQ-boNGuAA50yy7mxbag9FqurcQabKgFA%2BErcA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to