How to monitor the size of a directory via Telegraf
问题 We need to monitor the size of a directory (for example the data directory of InfluxDB) to set up alerts in Grafana. As mentioned here: How to configure telegraf to send a folder-size to influxDB , there is no built-in plugin for this. We don't mind using the inputs.exec section of Telegraf. The directories are not huge (low filecount + dircount), so deep scanning (like the use of du ) is fine by us. One of the directories we need to monitor is /var/lib/influxdb/data . What would be a simple