Hello,
I have a MQTT broker to receive some sensor values (temperature, pressure, humidity…) and send to Home Assistant.
I want to store this data in InfluxDB with Telegraf. So first I need to ensure that I can read this data from mosquitto broker with Telegraf.
The mosquitto and telegraf are in docker, the mosquitto log say that the telegraf is well connected:
1572644970: New connection from 172.18.0.6 on port 1883.
1572644970: New client connected from 172.18.0.6 as telegraf (p2, c1, k60, u’my_user’).
And this is the telegraf log:
2019-11-01T21:49:30Z I! [inputs.mqtt_consumer] Connected [tcp://mosquitto:1883]
This is the configuration:
telegraf.conf
[[inputs.mqtt_consumer]]
servers = [“tcp://mosquitto:1883”]
topics = [“temperature/linkquality/humidity/pressure/battery/voltage”,]
qos = 0
connection_timeout = “30s”
persistent_session = false
client_id = “telegraf”
username = “my_user”
password = “my_password”
data_format = “json”
mosquitto.conf:
{
“logins”: [
{
“username”: “my_user”,
“password”: “my_password”
}
],
“anonymous”: false,
“customize”: {
“active”: false,
“folder”: “mosquitto”
},
}
How could I check that all the sensor data is arriving to telegraf? Is there any easy way to check?
I am new in the software and I will appreciate your help.
Regards.