kpetremann / mqtt-exporter

Simple generic MQTT Prometheus exporter for IoT working out of the box
https://hub.docker.com/r/kpetrem/mqtt-exporter
MIT License
108 stars 30 forks source link

Failed to export anything except permit_join #2

Closed zubairov closed 3 years ago

zubairov commented 3 years ago

Great tool BTW, exactly what I was looking for, however....

I'm running the latest version of the exporter like this:

docker run -it --rm -p 9110:9000 -e "MQTT_ADDRESS=192.168.178.56" -e "LOG_LEVEL=DEBUG" kpetrem/mqtt-exporter

Getting this output:

DEBUG:mqtt-exporter:failed to parse as JSON: "b'online'"
DEBUG:mqtt-exporter:Failed to convert commit: cb9699e
DEBUG:mqtt-exporter:Failed to convert coordinator: {'meta': {'maintrel': 3, 'majorrel': 2, 'minorrel': 6, 'product': 0, 'revision': 20190608, 'transportrev': 2}, 'type': 'zStack12'}
DEBUG:mqtt-exporter:Failed to convert log_level: info
DEBUG:mqtt-exporter:Failed to convert network: {'channel': 11, 'extendedPanID': '0xdddddddddddddddd', 'panID': 6754}
INFO:mqtt-exporter:creating prometheus metric: mqtt_permit_join
DEBUG:mqtt-exporter:new value for mqtt_permit_join: 1.0
DEBUG:mqtt-exporter:Failed to convert version: 1.16.1

and can only see these measurements:

# HELP python_gc_objects_collected_total Objects collected during gc
# TYPE python_gc_objects_collected_total counter
python_gc_objects_collected_total{generation="0"} 119.0
python_gc_objects_collected_total{generation="1"} 257.0
python_gc_objects_collected_total{generation="2"} 0.0
# HELP python_gc_objects_uncollectable_total Uncollectable object found during GC
# TYPE python_gc_objects_uncollectable_total counter
python_gc_objects_uncollectable_total{generation="0"} 0.0
python_gc_objects_uncollectable_total{generation="1"} 0.0
python_gc_objects_uncollectable_total{generation="2"} 0.0
# HELP python_gc_collections_total Number of times this generation was collected
# TYPE python_gc_collections_total counter
python_gc_collections_total{generation="0"} 38.0
python_gc_collections_total{generation="1"} 3.0
python_gc_collections_total{generation="2"} 0.0
# HELP python_info Python platform information
# TYPE python_info gauge
python_info{implementation="CPython",major="3",minor="8",patchlevel="6",version="3.8.6"} 1.0
# HELP process_virtual_memory_bytes Virtual memory size in bytes.
# TYPE process_virtual_memory_bytes gauge
process_virtual_memory_bytes 2.369536e+07
# HELP process_resident_memory_bytes Resident memory size in bytes.
# TYPE process_resident_memory_bytes gauge
process_resident_memory_bytes 1.7379328e+07
# HELP process_start_time_seconds Start time of the process since unix epoch in seconds.
# TYPE process_start_time_seconds gauge
process_start_time_seconds 1.60624716527e+09
# HELP process_cpu_seconds_total Total user and system CPU time spent in seconds.
# TYPE process_cpu_seconds_total counter
process_cpu_seconds_total 0.22
# HELP process_open_fds Number of open file descriptors.
# TYPE process_open_fds gauge
process_open_fds 10.0
# HELP process_max_fds Maximum number of open file descriptors.
# TYPE process_max_fds gauge
process_max_fds 1.048576e+06
# HELP mqtt_permit_join metric generated from MQTT message.
# TYPE mqtt_permit_join gauge
mqtt_permit_join{topic="zigbee2mqtt_bridge_config"} 1.0

The zigbee2mqtt log looks like this:

Zigbee2MQTT:info  2020-11-24 20:26:36: Logging to console and directory: '/opt/zigbee2mqtt/data/log/2020-11-24.20-26-35' filename: log.txt
Zigbee2MQTT:info  2020-11-24 20:26:37: Starting Zigbee2MQTT version 1.16.1 (commit #cb9699e)
Zigbee2MQTT:info  2020-11-24 20:26:37: Starting zigbee-herdsman...
Zigbee2MQTT:info  2020-11-24 20:26:39: zigbee-herdsman started
Zigbee2MQTT:info  2020-11-24 20:26:39: Coordinator firmware version: '{"meta":{"maintrel":3,"majorrel":2,"minorrel":6,"product":0,"revision":20190608,"transportrev":2},"type":"zStack12"}'
Zigbee2MQTT:info  2020-11-24 20:26:40: Currently 0 devices are joined:
Zigbee2MQTT:warn  2020-11-24 20:26:40: `permit_join` set to  `true` in configuration.yaml.
Zigbee2MQTT:warn  2020-11-24 20:26:40: Allowing new devices to join.
Zigbee2MQTT:warn  2020-11-24 20:26:40: Set `permit_join` to `false` once you joined all devices.
Zigbee2MQTT:info  2020-11-24 20:26:40: Zigbee: allowing new devices to join.
Zigbee2MQTT:info  2020-11-24 20:26:40: Connecting to MQTT server at mqtt://localhost
Zigbee2MQTT:info  2020-11-24 20:26:40: Connected to MQTT server
Zigbee2MQTT:info  2020-11-24 20:26:40: MQTT publish: topic 'zigbee2mqtt/bridge/state', payload 'online'
Zigbee2MQTT:info  2020-11-24 20:26:40: MQTT publish: topic 'zigbee2mqtt/bridge/config', payload '{"commit":"cb9699e","coordinator":{"meta":{"maintrel":3,"majorrel":2,"minorrel":6,"product":0,"revision":20190608,"transportrev":2},"type":"zStack12"},"log_level":"info","network":{"channel":11,"extendedPanID":"0xdddddddddddddddd","panID":6754},"permit_join":true,"version":"1.16.1"}'
Zigbee2MQTT:info  2020-11-24 20:32:27: Device '0x00158d00024a13d1' joined
Zigbee2MQTT:info  2020-11-24 20:32:27: Starting interview of '0x00158d00024a13d1'
zubairov commented 3 years ago

False alarm, sorry it actually works. I just need to wait a few minutes. Great project BTW. Thanks.

kpetremann commented 3 years ago

perfect :) Don't hesitate if you need anything.

Great project BTW Thanks!