Playing around with MQTT and Zabbix for a few weeks now and since I added a new sensor last week I notice a strange behaviour.
It seems that sometimes the Zabbix Agent2 sends back the information for all topics instead of the one I request. Normally that doesn't come to surface because you determine values from JSON afterwards, but with multiple topics with same responses you get unpredictable results.
For example: in my zabbix_agent2.conf I have:
In Zabbix I have hosts with the name sensor1, sensor2 and sensor3, all have an MQTT Broker item:
and an item that gets the value I need through a JSONPath preprocessor. Say that sensor1 and sensor2 give me a temperature (so both have the same JSONPath parameter), and sensor3 gives me something else (so a JSONPath different parameter).
This works well - most of the time.
Sometimes I see in the mqtt.get results JSON results from all the topics (i.e. sensor1, 2 and 3). When (in case of sensor1 and 2) I use the same JSONPath delimiter, I get different results:

I've noticed this a couple of times last week, and it was gone when I restarted the zabbix_agent2 daemon. This morning at 08:16 I updated Zabbix to the latest version and it started again. At 08:48 it stops, the only thing I did there was restarting the agent. No configuration changes or other changes were made.
Someone have a similar experience?
Versions: Zabbix 5.2.5 (Server + agent2) on an Ubuntu 20.04 LTS server.
It seems that sometimes the Zabbix Agent2 sends back the information for all topics instead of the one I request. Normally that doesn't come to surface because you determine values from JSON afterwards, but with multiple topics with same responses you get unpredictable results.
For example: in my zabbix_agent2.conf I have:
Code:
Hostname=server1,sensor1,sensor2,sensor3
Code:
mqtt.get[,"tele/sensor1/SENSOR"] mqtt.get[,"tele/sensor2/SENSOR"] mqtt.get[,"tele/sensor3/SENSOR"]
This works well - most of the time.
Sometimes I see in the mqtt.get results JSON results from all the topics (i.e. sensor1, 2 and 3). When (in case of sensor1 and 2) I use the same JSONPath delimiter, I get different results:
I've noticed this a couple of times last week, and it was gone when I restarted the zabbix_agent2 daemon. This morning at 08:16 I updated Zabbix to the latest version and it started again. At 08:48 it stops, the only thing I did there was restarting the agent. No configuration changes or other changes were made.
Someone have a similar experience?
Versions: Zabbix 5.2.5 (Server + agent2) on an Ubuntu 20.04 LTS server.