Install InfluxDB

  • Create network for dockers, it's better you create network for the dockers, then you can access docker with name
docker network create IoT
  • Create /data and /data/influx dir for docker volume
mkdir /data
mkdir /data/influx
  • Start influxDB with docker, The official docker image here
docker run -p 8086:8086 \
    -v /data/influx/influxdb:/var/lib/influxdb \
    -v /data/influx/influxdb2:/var/lib/influxdb2 \
    -v /data/influx/influxdb2-config:/etc/influxdb2 \
    -v /data/influx/influxdb.conf:/etc/influxdb/influxdb.conf \
    --network=IoT \
    -d \
    --restart always \
    --name influx \
  • Now access

Install telegraf

  • Create telegraf dir
mkdir /data/telegraf
  • Switch to /data/telegraf folder
cd /data/telegraf
  • Before you can mount local config file to telegraf, make sure there is telegraf.conf exists
docker run --rm telegraf telegraf config > telegraf.conf

       telegraf.conf is auto generated under /data/telegraf/ folder, then edit the config you want, mine will like this.

vim telegraf.conf
# Configuration
  interval = "10s"
  round_interval = true
  metric_batch_size = 1000
  metric_buffer_limit = 10000
  collection_jitter = "0s"
  flush_interval = "10s"
  flush_jitter = "0s"
  precision = ""
  hostname = ""
  omit_hostname = false
  urls = [""]
  token = "yDLG7pUZbX5uCTMf6Qnopd62yOkhazUMeRco3sP3m6syHnn0nGS1xyj-vA3f7YinUYWH6J5pwH7_YMOu0HaKiQ=="
  organization = "ConST"
  bucket = "Default"
  percpu = true
  totalcpu = true
  collect_cpu_time = false
  report_active = false
  ignore_fs = ["tmpfs", "devtmpfs", "devfs", "iso9660", "overlay", "aufs", "squashfs"]

       You can get information from, navigate to data->telegraf, then create configuration with system plugin

  • Now you can start telegraf docker
docker run -v $PWD/telegraf.conf:/etc/telegraf/telegraf.conf:ro \
    --restart always \
    --name=telegraf \
    -d  \

      It should say "connected" after a little while, the system monitor dashboard will auto created and loaded.