add Name prefix to influxdb Telegraf plugin (#4198)

This commit is contained in:
Matou25 2025-12-17 09:37:52 +01:00 committed by GitHub
parent fb27dc4444
commit 4b64525274
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 14 additions and 0 deletions

View file

@ -12,6 +12,10 @@ WWW: https://www.influxdata.com/time-series-platform/telegraf/
Plugin Changelog
================
1.12.14
* Add name_prefix in influxdb config
1.12.13
* Implement memory_saving_mode formerly named enable_file_download (contributed by sopex)

View file

@ -27,6 +27,12 @@
<type>text</type>
<help>Write timeout (for the InfluxDB client), formatted as a string. If not provided, will default to 5s. 0s means no timeout (not recommended).</help>
</field>
<field>
<id>output.influx_name_prefix</id>
<label>Name Prefix</label>
<type>text</type>
<help>Specifies a prefix to attach to the measurement name, formatted as a string.</help>
</field>
<field>
<id>output.influx_username</id>
<label>Username</label>

View file

@ -19,6 +19,7 @@
<Default>5</Default>
<Required>N</Required>
</influx_timeout>
<influx_name_prefix type="TextField"/>
<influx_username type="TextField">
<Default></Default>
<Required>N</Required>

View file

@ -66,6 +66,9 @@
{% if helpers.exists('OPNsense.telegraf.output.influx_timeout') and OPNsense.telegraf.output.influx_timeout != '' %}
timeout = "{{ OPNsense.telegraf.output.influx_timeout }}s"
{% endif %}
{% if helpers.exists('OPNsense.telegraf.output.influx_name_prefix') and OPNsense.telegraf.output.influx_name_prefix != '' %}
name_prefix = "{{ OPNsense.telegraf.output.influx_name_prefix }}"
{% endif %}
{% if helpers.exists('OPNsense.telegraf.output.influx_username') and OPNsense.telegraf.output.influx_username != '' %}
username = "{{ OPNsense.telegraf.output.influx_username }}"
{% endif %}