It's possible to run telegraf with both a config file and config directory. The patch adds telegraf_confdir to allow optional use of a configuration directory.
Created attachment 205878 [details] patch
Created attachment 205900 [details] revised patch I got some feedback from matthew@ and the new version explicitly defaults telegraph_confdir to any empty string. Also my original comment did not document that my patch also changes the flags to use "--" instead of "-". Both seem to work but the usage message shows "--" so it seems better to use that.
A commit references this bug: Author: leres Date: Wed Sep 25 20:03:49 UTC 2019 New revision: 512808 URL: https://svnweb.freebsd.org/changeset/ports/512808 Log: net-mgmt/telegraf: Add a rc.conf option for the --config-directory option While we're here: - Sort ONLY_FOR_ARCHS as per portlint - Match "telegraf -h" usage message (-quiet, -config -> --quiet, --config) PR: 239291 Approved by: girgen (maintainer timeout, 9 weeks), matthew (mentor, implicit) Changes: head/net-mgmt/telegraf/Makefile head/net-mgmt/telegraf/files/telegraf.in