Skip to content

Instantly share code, notes, and snippets.

@mschmitt
Created August 23, 2024 06:25
Show Gist options
  • Save mschmitt/b2daa9ba1aefa1c8edaf1c74d4506189 to your computer and use it in GitHub Desktop.
Save mschmitt/b2daa9ba1aefa1c8edaf1c74d4506189 to your computer and use it in GitHub Desktop.
Iobroker -> Telegraf -> Prometheus -> Grafana
# /etc/telegraf/telegraf.d/prometheus-exporter.conf
# Subscribe to relevant MQTT topics from ioBroker
[[inputs.mqtt_consumer]]
servers = ["tcp://[::1]:1881"]
username = "***"
password = "***"
topics = [
"0_userdata/0/sensor/einpersonensauna/+",
"0_userdata/0/stromzaehler/+/+",
"ahoydtu/total/P_AC"
]
topic_tag = 'iobroker_mqtt_topic'
data_format = "value"
data_type = "auto_float"
# Pretend I'm a prometheus exporter
[[outputs.prometheus_client]]
listen = "[::1]:9274"
collectors_exclude = ["gocollector", "process"]
expiration_interval = "901s"
# Bonus Content: A curl job that delivers weather data as JSON
[[inputs.exec]]
interval="900s"
commands = ["/usr/local/bin/wundercurl.sh"]
name_suffix = "_wunderground"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment