Monitoring Disk usage of /opt folder

Hello,
I want to use the Disk Input Plugin to monitor the disk usage (size) of my opt folder and all the folders under (i use the folder and subfolders for persistent storage for my docker containers)

Here is my docker compose for telegraf: (note that I am also using it to monitor my containers)

telegraf:
    container_name: telegraf
    image: telegraf:latest
    volumes:
      - /opt/telegraf/telegraf.conf:/etc/telegraf/telegraf.conf
      - /var/run/docker.sock:/var/run/docker.sock
      - /:/hostfs:ro
      - /proc/1/mounts:/foo/etc/mtab
    environment:
      - DOCKER_INFLUXDB_INIT_ORG=myrgangen
      - DOCKER_INFLUXDB_INIT_BUCKET=DockerMonitoring
      - DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=(removed)
      - HOST_MOUNT_PREFIX=/hostfs
      - HOST_PROC=/hostfs/proc
      - HOST_ETC=/foo/etc
    links:
      - influxdb
    depends_on:
      - influxdb
    ports:
      - 8125:8125
      - 8092:8092
      - 8094:8094

and here is my [[inputs.disk]] configuration in telegraf.conf:

[[inputs.disk]]
 
  ignore_fs = ["tmpfs", "devtmpfs", "devfs", "iso9660", "overlay", "aufs", "squashfs"]

but when run the container, I don’t see my /opt folder in the path Tag?

Hi,

The disk plugin will report stats on various mount points, not individual folders. Unless /opt is a specific mount from a different disk or partition, it will not show up.

As the readme states, the data is generally derived from /proc/self/mounts or even running the mounts command will get you a list of all the possible devices the plugin can monitor.