Telegraf inputs.exec custom scripts

The file
/usr/share/vyos/templates/telegraf/telegraf.j2
contains section in the end:

{% if influxdb_configured is vyos_defined %}
[[inputs.exec]]
commands = [
“{{ custom_scripts_dir }}/show_firewall_input_filter.py”,
“{{ custom_scripts_dir }}/show_interfaces_input_filter.py”,
“{{ custom_scripts_dir }}/vyos_services_input_filter.py”
]
timeout = “10s”
data_format = “influx”
{% endif %}

Can you tell what the condition “if influxdb_configured is vyos_defined” means? I have influxdb configured but this section is not present in /run/telegraf/telegraf.conf.
What would be the best way to add my custom script to inputs.exec section of telegraf configuration ?

If you don’t have this section it maybe bug
I’ll check later
Which version?
Did you check it with the latest rolling?

Thank you, @Viacheslav, that has been already resolved. I put custom telegraf config to /etc/telegraf/telegraf.d and my custom script to /etc/telegraf/custom_scripts. That works fine.

@aserkin By the way I created a bug report T4747
Thanks

1 Like