Fix in ping telegraf plugin, the "count" to be a "arguments". (#4359)

its the correct way to configure ping to use the "binary" file.
(the "count" is a parameter passed to the ping binary).
This commit is contained in:
Alex W. Baulé
2024-12-01 09:46:03 +01:00
committed by GitHub
parent 088ab968c7
commit 60b0bfea87
@@ -318,19 +318,19 @@
urls = [{{ "'" + ("','".join(OPNsense.telegraf.input.ping_hosts.split(','))) + "'" }}]
{% endif %}
{% if helpers.exists('OPNsense.telegraf.input.ping_count') and OPNsense.telegraf.input.ping_count != '' %}
count = {{ OPNsense.telegraf.input.ping_count }}
arguments = ["-4", "-c", "{{ OPNsense.telegraf.input.ping_count }}"]
{% endif %}
{% endif %}
{% if helpers.exists('OPNsense.telegraf.input.ping6') and OPNsense.telegraf.input.ping6 == '1' %}
[[inputs.ping]]
method = "exec"
binary = "ping6"
binary = "ping"
{% if helpers.exists('OPNsense.telegraf.input.ping6_hosts') and OPNsense.telegraf.input.ping6_hosts != '' %}
urls = [{{ "'" + ("','".join(OPNsense.telegraf.input.ping6_hosts.split(','))) + "'" }}]
{% endif %}
{% if helpers.exists('OPNsense.telegraf.input.ping6_count') and OPNsense.telegraf.input.ping6_count != '' %}
count = {{ OPNsense.telegraf.input.ping6_count }}
arguments = ["-6", "-c", "{{ OPNsense.telegraf.input.ping6_count }}"]
{% endif %}
{% endif %}