MQTT Data Exporter for Prometheus. Exports any message convertible to float from MQTT to prometheus.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Vladimir Smagin 2dbb2cea58 move to docker only version 5 months ago
.gitignore move to docker only version 5 months ago
Dockerfile move to docker only version 5 months ago
Jenkinsfile move to docker only version 5 months ago
VERSION move to docker only version 5 months ago
config.py move to docker only version 5 months ago
mqtt-data-exporter.py added license 1 year ago
readme.md move to docker only version 5 months ago
requirements.txt import 1 year ago

readme.md

MQTT Data Exporter

This program reads numbers from MQTT bus and exposes to Prometheus as gauge values. Nice tool to monitor sensors.

Example of exposed values:

ACCEPTED /device/5C:CF:7F:3D:C3:9F/termo/1/data _device_5ccf7f3dc39f_termo_1_data 13.69
ACCEPTED /device/5C:CF:7F:3D:C3:9F/relay/1/data _device_5ccf7f3dc39f_relay_1_data 0.0
ACCEPTED /device/60:01:94:0D:E5:82/lights/1/data _device_6001940de582_lights_1_data 1.0
ACCEPTED /device/60:01:94:0D:E5:82/RSSI _device_6001940de582_rssi -64.0
IGNORED /hello/A0:20:A6:13:60:0D _hello_a020a613600d termo[1],pressure[1],humidity[1]
IGNORED /device/A0:20:A6:13:60:0D/hostname _device_a020a613600d_hostname modA020A613600D
IGNORED /device/A0:20:A6:13:60:0D/devicename _device_a020a613600d_devicename A0:20:A6:13:60:0D
IGNORED /device/A0:20:A6:13:60:0D/IP _device_a020a613600d_ip 192.168.1.21

Docker

Set variables and run:

docker run --name mqttde_container -d \
  -e MQTTHOST=mqtt.server.ru \
  -e MQTTPORT=1883 \
  -e MQTTUSER=bus \
  -e MQTTPASS=myultrapassword \
  -e EXPOTIMEOUT=60 \
  -p 9021:9021 iam21h/mqtt-data-exporter:0.0.1

Checkout local port 9021:

$> curl http://localhost:9021/metrics

Default values:

  • MQTTHOST: mqtt
  • MQTTPORT: 1883
  • MQTTUSER: mqtt
  • MQTTPASS:
  • EXPOTIMEOUT: 60

License

MQTT-DATA-EXPORTER Copyright (C) 2018-2019 Vladimir Smagin, http://blindage.org

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Questions?

If you have any questions mail me to 21h@blindage.org.