diff --git a/telegraf.conf b/telegraf.conf index 927a1e8..9c33e74 100644 --- a/telegraf.conf +++ b/telegraf.conf @@ -9,65 +9,78 @@ flush_interval = "10s" flush_jitter = "0s" precision = "" - hostname = "bUZverse" + hostname = "BuzzVerse" omit_hostname = false [[outputs.influxdb_v2]] urls = ["http://influxdb:8086"] token = "gwTFtAnBRUM3OYmwsZ0GTg2C6r63bZ1G" - organization = "bUZzverse" + organization = "BuzzVerse" bucket = "lora_db" - -[[processors.override]] - order = 1 - name_override = "SENSOR_CHYNOW" - [processors.override.tagpass] - topic = ["tele/lora/SENSOR_CHYNOW"] - -[[processors.override]] - order = 2 - name_override = "SENSOR_SPANISH" - [processors.override.tagpass] - topic = ["tele/lora/SENSOR_SPANISH"] -[[inputs.mqtt_consumer]] + [[inputs.mqtt_consumer]] servers = ["tcp://mosquitto:1883"] + username = "admin" + password = "zaq1@WSX" topics = [ - "tele/lora/+" + "sensors/+/data", ] + topic_tag = "device_id" data_format = "json_v2" - username = "admin" - password = "zaq1@WSX" + + [[inputs.mqtt_consumer.topic_parsing]] + topic = "sensors/+/data" + measurement = "sensor_data" + tags = "_/device_id/_" + [[inputs.mqtt_consumer.json_v2]] - timestamp_path = "time" - timestamp_format = "unix_ms" - timestamp_timezone = "Europe/Warsaw" - [[inputs.mqtt_consumer.json_v2.field]] - path = "temperature" - type = "float" - optional = false - [[inputs.mqtt_consumer.json_v2.field]] - path = "humidity" - type = "float" - optional = false - [[inputs.mqtt_consumer.json_v2.field]] - path = "pressure" - type = "float" - optional = true - [[inputs.mqtt_consumer.json_v2.field]] - path = "battery_voltage_mv" - type = "float" - optional = true + measurement_name = "sensor_data" + + # BME280 sensor + [[inputs.mqtt_consumer.json_v2.object]] + path = "BME280" + optional = true + tags = ["BME280"] + [inputs.mqtt_consumer.json_v2.object.fields] + temperature = "float" + humidity = "float" + pressure = "float" -[[inputs.cpu]] - percpu = true - totalcpu = true - collect_cpu_time = false - report_active = false + # GPS sensor + [[inputs.mqtt_consumer.json_v2.object]] + path = "GPS" + optional = true + tags = ["GPS", "HEATMAP"] + [inputs.mqtt_consumer.json_v2.object.fields] + status = "int" + altitude = "float" + latitude = "float" + longitude = "float" -[[inputs.disk]] - ignore_fs = ["tmpfs", "devtmpfs", "devfs", "iso9660", "overlay", "aufs", "squashfs"] + # BMA400 sensor + [[inputs.mqtt_consumer.json_v2.object]] + path = "BMA400" + optional = true + tags = ["BMA400"] + [inputs.mqtt_consumer.json_v2.object.fields] + x = "float" + y = "float" + z = "float" -[[inputs.mem]] + # MQ2 sensor + [[inputs.mqtt_consumer.json_v2.object]] + path = "MQ2" + optional = true + tags = ["MQ2"] + [inputs.mqtt_consumer.json_v2.object.fields] + gas_type = "int" + value = "float" -[[inputs.processes]] + # META + [[inputs.mqtt_consumer.json_v2.object]] + path = "META" + optional = true + tags = ["META"] + [inputs.mqtt_consumer.json_v2.object.fields] + rssi = "float" + snr = "float" \ No newline at end of file