To tell Telegraf to ignore specific file system types, you need to configure the disk input plugin in your Telegraf configuration file (telegraf.conf). Here's how:
Locate your Telegraf configuration file. The default location is usually:
Linux: /etc/telegraf/telegraf.conf
Windows: In the directory where you extracted the Telegraf zip file (e.g., C:\Program Files\Telegraf\telegraf.conf)
Open the telegraf.conf file in a text editor.
Find the [[inputs.disk]] section. If it doesn't exist, you can add it. This section configures the disk input plugin.
Add or modify the ignore_fs parameter. This parameter is an array of strings, where each string is a file system type you want Telegraf to ignore. Uncomment the line if it's commented out (remove the # at the beginning).
For example, to ignore tmpfs, devtmpfs, and iso9660 file systems, your configuration should look like this:
[[inputs.disk]]
## By default stats will be gathered for all mount points.
## Set mount_points will restrict the stats to only the specified mount points.
# mount_points = ["/"]
## Ignore mount points by filesystem type.
ignore_fs = ["tmpfs", "devtmpfs", "iso9660"]
## Ignore mount points by mount options.
## The 'mount' command reports options of all mounts in parathesis.
## Bind mounts can be ignored with the special 'bind' option.
# ignore_mount_opts = []
Save the telegraf.conf file.
Restart the Telegraf service for the changes to take effect. The command to restart Telegraf depends on your operating system:
Linux (using systemd): sudo systemctl restart telegraf
Linux (using SysVinit): sudo service telegraf restart
Windows (if Telegraf is running as a service): Restart-Service Telegraf in PowerShell as Administrator.
After restarting, Telegraf will no longer collect disk usage metrics for the file system types listed in the ignore_fs parameter.
Common file system types to ignore:
tmpfs: Temporary file system backed by RAM.
devtmpfs: Device file system.
devfs: Another type of device file system.
iso9660: File system for optical discs (CD-ROM, DVD).
overlay: Overlay file system.
aufs: Another union file system.
squashfs: Compressed read-only file system.
proc: Process information pseudo-filesystem.
sysfs: System information pseudo-filesystem.
cgroup: Control groups filesystem.
vboxsf: VirtualBox shared folder file system.
You can add any other file system types you want to exclude to the ignore_fs list. Please consult your system's /proc/mounts (on Linux/Unix) or use the mount command to identify the file system types you want to ignore.
See also: