Hi,
I have some weird issue with the MQTT plugin in Zabbix Agent 2 not getting data from MQTT broker (mosquitto) via plain tcp.
Some time ago I had this problem and the fix was to restart the agent, so I tried it this time too, but unfortunately it does not fix the issue.
I was using Zabbix 6.3 until I got to this issue and now I tried upgrading to 6.4 but the issue persists.
In /etc/zabbix/zabbix_agent2.d/plugins.d/mqtt.conf I tried setting Plugins.MQTT.Timeout=30 but this does not help.
Even tried to debug with tcpdump, it seems there are packets going in both directions, so I don't understand why the agent tells there is a timeout.
How could I debug why the agent tells, that the connection timed out, altough using mosquitto_sub it works perfectly fine?
zabbix_agent2.conf DebugLevel=3
I tried raising DebugLevel to 5 to see what causes the timeout but there it seems the agent is able to subscribe, but still gets no data?
zabbix_agent2.conf DebugLevel=5
Still in Zabbix Frontend all MQTT items have red [i] sign with error: "subscribe was broken by timeout". But still mosquitto_sub works fine:
Is this a bug in the MQTT plugin of agent2 or how could I debug/fix this?
Thank you and kind regards!
I have some weird issue with the MQTT plugin in Zabbix Agent 2 not getting data from MQTT broker (mosquitto) via plain tcp.
Some time ago I had this problem and the fix was to restart the agent, so I tried it this time too, but unfortunately it does not fix the issue.
I was using Zabbix 6.3 until I got to this issue and now I tried upgrading to 6.4 but the issue persists.
In /etc/zabbix/zabbix_agent2.d/plugins.d/mqtt.conf I tried setting Plugins.MQTT.Timeout=30 but this does not help.
Even tried to debug with tcpdump, it seems there are packets going in both directions, so I don't understand why the agent tells there is a timeout.
How could I debug why the agent tells, that the connection timed out, altough using mosquitto_sub it works perfectly fine?
zabbix_agent2.conf DebugLevel=3
Code:
# tail -f zabbix_agent2.log ... 2022/12/19 01:29:16.910583 using plugin 'MQTT' (built-in) providing following interfaces: watcher, configurator ... 2022/12/19 01:29:16.911186 Plugin support version 1.1 2022/12/19 01:29:16.911223 Zabbix Agent2 hostname: [Zabbix server] 2022/12/19 01:29:48.016759 [MQTT] cannot subscribe topic 'revpi75099/io/PS_Pumpenanl2_Alarm' to [tcp://10.34.0.208:1883]: timed out while subscribing ^C
zabbix_agent2.conf DebugLevel=5
Code:
2022/12/19 01:31:54.493723 [MQTT] established connection to [tcp://10.34.0.208:1883] ... 2022/12/19 01:31:54.495890 [MQTT] creating new subscriber on topic 'revpi75099/io/PS_Pumpenanl1_Status' for [tcp://10.34.0.208:1883] ... 2022/12/19 01:31:54.505217 [MQTT] subscribing 'revpi75099/io/KOL_Kollektor2_Leckwarnung' to [tcp://10.34.0.208:1883] 2022/12/19 01:31:54.548337 [MQTT] subscribed 'revpi75099/io/KOL_Kollektor2_Leckwarnung' to [tcp://10.34.0.208:1883]
Still in Zabbix Frontend all MQTT items have red [i] sign with error: "subscribe was broken by timeout". But still mosquitto_sub works fine:
Code:
# mosquitto_sub -h 10.34.0.208 -p 1883 -v -t "revpi75099/io/PS_Pumpenanl2_Alarm" -u client -P r34dMyD4t4 revpi75099/io/PS_Pumpenanl2_Alarm 1
Thank you and kind regards!

Comment