Im trying to have one config file-> telegraf.conf and other in /etc/telegraf/telegraf.d/
named test.conf with one swap metric.
After that i restart the service: systemctl restart telegraf
Using systemctl, what i have to do to read both config files, because using that i only read telegraf.conf.
Documentacion said:
On most systems, the default locations are /etc/telegraf/telegraf.conf for the main configuration file and /etc/telegraf/telegraf.d for the directory of configuration files.
So, in this case, My telegraf should read it test.conf too.
I read the post named “multiple telegraf configs” but i would like to have any daemon and use both configuration together in different files.
Im so confused about iT, what am i missing?
If I run telegraf:
telegraf --config-directory /etc/telegraf
then i combine both im not recording this configuration like by default.
But, checking my daemon executestart (i started with systemctl):
[Unit]
Description=The plugin-driven server agent for reporting metrics into InfluxDB
Documentation=https://github.com/influxdata/telegraf
After=network.target
But, the real loaded inputs even when I have the execute start with --config-directory /etc/telegraf/telegraf.d, it doesn’t have input.swap and i dont insert anything in influxdb about swap metrics.
So, I dont know what is missing for me, or if it is not possible to have this working properly with systemctl.
I was researching more options and I think that I can use “mmonit” instead the daemon with systemctl because I dont find any solution about it or what im missing.
Its odd because im using the same (telegraf --config /etc/telegraf/telegraf.conf --config-directory /etc/telegraf/telegraf.d) but the first in command line and the second one with systemctl.
When run as a service Telegraf runs as the telegraf user, perhaps the configuration files or directory does not have the right permissions to allow this user to read them?