net-mgmt/telegraf: Allow to specify ping count (#2374)

Telegraf by default sends one ICMP packet, to make use of fields like
`standard_deviation_ms` or `average_response_ms` we need more than one
value.
This commit is contained in:
Kacper Michajłow
2022-06-29 14:22:54 +02:00
committed by GitHub
parent 8f062c3a86
commit 99c4dbd474
3 changed files with 24 additions and 0 deletions
@@ -91,6 +91,12 @@
<type>checkbox</type>
<help>Ping Hosts using IPv4 and measure the metrics.</help>
</field>
<field>
<id>input.ping_count</id>
<label>Ping Count (IPv4)</label>
<type>text</type>
<help>Number of ping packets to send per interval. Corresponds to the "-c" option of the ping command.</help>
</field>
<field>
<id>input.ping_hosts</id>
<label>Ping Hosts (IPv4)</label>
@@ -105,6 +111,12 @@
<type>checkbox</type>
<help>Ping Hosts using IPv6 and measure the metrics.</help>
</field>
<field>
<id>input.ping6_count</id>
<label>Ping Count (IPv6)</label>
<type>text</type>
<help>Number of ping packets to send per interval. Corresponds to the "-c" option of the ping command.</help>
</field>
<field>
<id>input.ping6_hosts</id>
<label>Ping Hosts (IPv6)</label>
@@ -63,6 +63,9 @@
<default>0</default>
<Required>N</Required>
</ping>
<ping_count type="IntegerField">
<Required>N</Required>
</ping_count>
<ping_hosts type="CSVListField">
<Required>N</Required>
</ping_hosts>
@@ -70,6 +73,9 @@
<default>0</default>
<Required>N</Required>
</ping6>
<ping6_count type="IntegerField">
<Required>N</Required>
</ping6_count>
<ping6_hosts type="CSVListField">
<Required>N</Required>
</ping6_hosts>
@@ -234,6 +234,9 @@
{% if helpers.exists('OPNsense.telegraf.input.ping_hosts') and OPNsense.telegraf.input.ping_hosts != '' %}
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 }}
{% endif %}
{% endif %}
{% if helpers.exists('OPNsense.telegraf.input.ping6') and OPNsense.telegraf.input.ping6 == '1' %}
@@ -243,6 +246,9 @@
{% 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 }}
{% endif %}
{% endif %}
{% if helpers.exists('OPNsense.telegraf.input.haproxy') and OPNsense.telegraf.input.haproxy == '1' %}