Telegraf test input and output plugins error multiple conf files

[亡魂溺海] 提交于 2021-02-11 10:18:29

问题


Telegraf version: Telegraf v1.0.1

I have the following files:

/etc/telegraf/telegraf.conf 

main config file (which you create/get for free while installing telegraf). This file doesn't have any [[output.<plugin>]] stanza in it but does have valid default inputs.xx plugins enabled.

/etc/telegraf/telegraf.d/1-company-output-plugin.conf 

(This file has valid outputs.<pluginname> plugin).

/etc/telegraf/telegraf.d/telegraf-additional-inputs-plugins.conf 

(this file has additional inputs.<pluginname> plugins that I want to keep separate from the main conf file).


Running sudo service telegraf status shows Telegraf is running [OK]! and log file /var/log/telegrag/telegraf.log (looks good too without showing any errors).

If I make any changes to one of the above configuration files, I want to test those changes made (before I restart telegraf), so I'm running the following commands with -test or --test option but I'm getting the following error:

ubuntu@jenkins:~/test_aks_dir$ telegraf --config /etc/telegraf/telegraf.conf -test
2017/01/10 22:45:48 E! Error: no outputs found, did you provide a valid config file?
ubuntu@jenkins:~/test_aks_dir$ telegraf --config /etc/telegraf/telegraf.conf --test
2017/01/10 22:45:51 E! Error: no outputs found, did you provide a valid config file?

As you see above, both optons -test or --test worked but also gave a valid error message above.

As the above error was for not providing any configuration stanza for [[outputs.<plugin>]], I provided another --config file paramter for the file which contains the outputs plugin stanza, but now it gave an error for the missing inputs. file:

ubuntu@jenkins:~/test_aks_dir$ telegraf --config /etc/telegraf/telegraf.conf --config /etc/telegraf/telegraf.d/1-company-output-plugin.conf  --test
2017/01/10 22:48:30 E! Error: no inputs found, did you provide a valid config file?
ubuntu@jenkins:~/test_aks_dir$ 

Note: The above command didn't error for providing multiple --config <someConfigFile> parameter values.

The same error comes if I want to test any change in the 3rd file : (/etc/telegraf/telegraf.d/telegraf-additional-inputs-plugins.conf)

How can I test an individual or selective configuration file changes using telegraf assuming I have multiple files here: /etc/telegraf/telegraf.d/*.conf ?


回答1:


this is not possible at the moment, the only way to do it would be to specify the entire config directory



来源:https://stackoverflow.com/questions/41579902/telegraf-test-input-and-output-plugins-error-multiple-conf-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!