# Read metrics from MQTT topic(s) [[inputs.mqtt_consumer]] ## MQTT broker URLs to be used. The format should be scheme://host:port, schema can be tcp, ssl, or ws. servers = ["tcp://localhost:1883"] ## MQTT QoS, must be 0, 1, or 2 qos = 2 ## Connection timeout for initial connection in seconds #connection_timeout = "30s" ## Topics to subscribe to topics = [ "/+/+/+/rssi", "/+/+/+/mag/#", "/+/+/+/mag", "/+/+/+/xcnt/#", "TestResults", ] # if true, messages that can't be delivered while the subscriber is offline will be delivered when it comes back (such # as on service restart). NOTE: if true, client_id MUST be set persistent_session = false # If empty, a random client ID will be generated. client_id = "" ## username and password to connect MQTT server. # username = "telegraf" password = "metricsmetricsmetricsmetrics" ## Optional SSL Config # ssl_ca = "/etc/telegraf/ca.pem" ssl_cert = "/etc/telegraf/cert.pem" ssl_key = "/etc/telegraf/key.pem" ## Use SSL but skip chain & host verification # insecure_skip_verify = false ## Data format to consume. Each data format has its own unique set of configuration options, read more about them ## here: https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md #data_format = "influx" data_format = "value" ############################################################################### # Read metrics from MQTT topic(s) FLOATS [[inputs.mqtt_consumer]] name_override = "mqtt_consumer_floats" servers = ["tcp://localhost:1883"] qos = 2 #connection_timeout = "30s" topics = [ "/+/+/+/volt/#", "/+/+/+/TMP/#", "/+/+/+/HUM/#", "/+/+/+/BEA", "/+/+/+/LUM/#", "/+/+/+/dis/#", "/+/+/+/DIS/#", "/+/dogfoodpercent", ] persistent_session = false client_id = "" # insecure_skip_verify = false data_format = "influx" data_format = "value" data_type = "float" ############################################################################### # Read metrics from MQTT topic(s) strings [[inputs.mqtt_consumer]] name_override = "mqtt_consumer_string" servers = ["tcp://localhost:1883"] qos = 2 #connection_timeout = "30s" topics = [ "/g/g/+/location/#", ] persistent_session = false client_id = "" # insecure_skip_verify = false data_format = "influx" # insecure_skip_verify = false data_format = "influx" data_format = "value" data_type = "string" ############################################################################### ############################################################################### # OUTPUT PLUGINS # ############################################################################### # Configuration for influxdb server to send metrics to [[outputs.influxdb]] ## The full HTTP or UDP URL for your InfluxDB instance. ## ## Multiple urls can be specified as part of the same cluster, this means that only ONE of the urls will be written to ## each interval. # urls = ["udp://127.0.0.1:8089"] # UDP endpoint example urls = ["http://localhost:8086"] # required ## The target database for metrics (telegraf will create it if not exists). database = "openhab_db" # required ## Name of existing retention policy to write to. Empty string writes to the default retention policy. retention_policy = "" ## Write consistency (clusters only), can be: "any", "one", "quorum", "all" write_consistency = "any" ## Write timeout (for the InfluxDB client), formatted as a string. If not provided, will default to 5s. 0s means no ## timeout (not recommended). timeout = "37s" # username = "telegraf" username = "openhab" # password = "metricsmetricsmetricsmetrics" password = "AnotherSuperbPassword456-" ## Set the user agent for HTTP POSTs (can be useful for log differentiation) user_agent = "telegraf" ## Set UDP payload size, defaults to InfluxDB UDP Client default (512 bytes) # udp_payload = 512 ## Optional SSL Config # ssl_ca = "/etc/telegraf/ca.pem" ssl_cert = "/etc/telegraf/cert.pem" ssl_key = "/etc/telegraf/key.pem" ## Use SSL but skip chain & host verification # insecure_skip_verify = false ## HTTP Proxy Config # http_proxy = "http://corporate.proxy:3128" ## Optional HTTP headers # http_headers = {"X-Special-Header" = "Special-Value"} ## Compress each HTTP request payload using GZIP. # content_encoding = "gzip"