diff --git a/net-mgmt/telegraf/Makefile b/net-mgmt/telegraf/Makefile index cf9937180..9704c0c8f 100644 --- a/net-mgmt/telegraf/Makefile +++ b/net-mgmt/telegraf/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= telegraf -PLUGIN_VERSION= 1.12.8 +PLUGIN_VERSION= 1.12.9 PLUGIN_COMMENT= Agent for collecting metrics and data PLUGIN_DEPENDS= telegraf PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net-mgmt/telegraf/pkg-descr b/net-mgmt/telegraf/pkg-descr index 1d198749a..190772aff 100644 --- a/net-mgmt/telegraf/pkg-descr +++ b/net-mgmt/telegraf/pkg-descr @@ -12,6 +12,10 @@ WWW: https://www.influxdata.com/time-series-platform/telegraf/ Plugin Changelog ================ +1.12.9 + +* Add MQTT output + 1.12.8 * bug: fix InfluxDB v2 template to remove erroneous `timeout` value (issue #3265, contributed by Gavin Chappell) diff --git a/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/output.xml b/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/output.xml index 2ea1ee342..9b1793318 100644 --- a/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/output.xml +++ b/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/output.xml @@ -215,4 +215,64 @@ text Set the API Key for accessing Datadog. + + output.mqtt_enable + + checkbox + This will enable writes to a MQTT Broker acting as a mqtt Producer. + + + output.mqtt_topic_prefix + + text + Topic for producer messages. + + + output.mqtt_servers + + text + URLs of mqtt brokers. Format is without square brackets, just like localhost:8083. + + + output.mqtt_qos + + text + QoS policy for messages. 0 = at most once, 1 = at least once, 2 = exactly once. Defaults to 2. + + + output.mqtt_username + + text + Set the username for authentication. + + + output.mqtt_password + + text + Set the password for authentication. + + + output.mqtt_client_id + + text + Client ID, if not set a random ID is generated. + + + output.mqtt_timeout + + text + Timeout for write operations. Default is 5s. + + + output.mqtt_insecure_skip_verify + + checkbox + Use TLS, but skip chain and host verification. + + + output.mqtt_format + + text + Data format to output. Defaults to "influx". + diff --git a/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Output.xml b/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Output.xml index 46015f226..baee0a02a 100644 --- a/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Output.xml +++ b/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Output.xml @@ -1,7 +1,7 @@ //OPNsense/telegraf/output Telegraf outputs configuration - 1.4.2 + 1.4.3 0 @@ -139,5 +139,56 @@ N + + 0 + N + + + + N + /^([0-9a-zA-Z._\-]){1,128}$/u + Only characters, numbers, a dot, underscore and hyphen allowed. Do not use more than 128 characters. + + + + N + + + + N + /^([0-9a-zA-Z._\-]){1,128}$/u + Only characters, numbers, a dot, underscore and hyphen allowed. Do not use more than 128 characters. + + + + N + 0 + 2 + Allowed values are 0-2 + + + 5 + N + + + + N + /^([0-9a-zA-Z._\-]){1,128}$/u + Only characters, numbers, a dot, underscore and hyphen allowed. Do not use more than 128 characters. + + + + N + + + 0 + N + + + + N + /^([0-9a-zA-Z._\-]){1,128}$/u + Only characters, numbers, a dot, underscore and hyphen allowed. Do not use more than 128 characters. + diff --git a/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf b/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf index c814150b9..355eb96a9 100644 --- a/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf +++ b/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf @@ -91,6 +91,39 @@ timeout = "5s" {% endif %} +{% if helpers.exists('OPNsense.telegraf.output.mqtt_enable') and OPNsense.telegraf.output.mqtt_enable == '1' %} +[[outputs.mqtt]] +{% if helpers.exists('OPNsense.telegraf.output.mqtt_servers') and OPNsense.telegraf.output.mqtt_servers != '' %} + servers = ["{{ OPNsense.telegraf.output.mqtt_servers }}"] +{% endif %} +{% if helpers.exists('OPNsense.telegraf.output.mqtt_topic_prefix') and OPNsense.telegraf.output.mqtt_topic_prefix != '' %} + topic_prefix = "{{ OPNsense.telegraf.output.mqtt_topic_prefix }}" +{% endif %} +{% if helpers.exists('OPNsense.telegraf.output.mqtt_qos') and OPNsense.telegraf.output.mqtt_qos != '' %} + topic_prefix = "{{ OPNsense.telegraf.output.mqtt_qos }}" +{% endif %} +{% if helpers.exists('OPNsense.telegraf.output.mqtt_client_id') and OPNsense.telegraf.output.mqtt_client_id != '' %} + client_id = "{{ OPNsense.telegraf.output.mqtt_client_id }}" +{% endif %} +{% if helpers.exists('OPNsense.telegraf.output.mqtt_timeout') and OPNsense.telegraf.output.mqtt_timeout != '' %} + timeout = "{{ OPNsense.telegraf.output.mqtt_timeout }}s" +{% endif %} +{% if helpers.exists('OPNsense.telegraf.output.mqtt_username') and OPNsense.telegraf.output.mqtt_username != '' %} + username = "{{ OPNsense.telegraf.output.mqtt_username }}" +{% endif %} +{% if helpers.exists('OPNsense.telegraf.output.mqtt_password') and OPNsense.telegraf.output.mqtt_password != '' %} + password = "{{ OPNsense.telegraf.output.mqtt_password }}" +{% endif %} +{% if helpers.exists('OPNsense.telegraf.output.mqtt_insecure_skip_verify') and OPNsense.telegraf.output.mqtt_insecure_skip_verify == '1' %} + insecure_skip_verify = true +{% else %} + insecure_skip_verify = false +{% endif %} +{% if helpers.exists('OPNsense.telegraf.output.mqtt_data_format') and OPNsense.telegraf.output.mqtt_data_format != '' %} + data_format = "{{ OPNsense.telegraf.output.mqtt_data_format }}" +{% endif %} +{% endif %} + {% if helpers.exists('OPNsense.telegraf.output.graphite_enable') and OPNsense.telegraf.output.graphite_enable == '1' %} [[outputs.graphite]] {% if helpers.exists('OPNsense.telegraf.output.graphite_server') and OPNsense.telegraf.output.graphite_server != '' %}