Fix for mixed ping plugin config (#4316)

With this, the "ipv4 vs ipv6" will be respected, and the count is respected too.

Signed-off-by: Alex W Baulé <alexwbaule@gmail.com>
This commit is contained in:
Alex W. Baulé
2024-10-22 07:33:46 +02:00
committed by GitHub
parent 72dfcfa12b
commit ee7868fa93
@@ -313,7 +313,8 @@
{% if helpers.exists('OPNsense.telegraf.input.ping') and OPNsense.telegraf.input.ping == '1' %}
[[inputs.ping]]
method = "exec"
method = "native"
ipv4 = true
{% if helpers.exists('OPNsense.telegraf.input.ping_hosts') and OPNsense.telegraf.input.ping_hosts != '' %}
urls = [{{ "'" + ("','".join(OPNsense.telegraf.input.ping_hosts.split(','))) + "'" }}]
{% endif %}
@@ -324,8 +325,8 @@
{% if helpers.exists('OPNsense.telegraf.input.ping6') and OPNsense.telegraf.input.ping6 == '1' %}
[[inputs.ping]]
method = "exec"
binary = "ping6"
method = "native"
ipv6 = true
{% if helpers.exists('OPNsense.telegraf.input.ping6_hosts') and OPNsense.telegraf.input.ping6_hosts != '' %}
urls = [{{ "'" + ("','".join(OPNsense.telegraf.input.ping6_hosts.split(','))) + "'" }}]
{% endif %}