MQTT SubAgent subscribing to more than one MQTT Publisher

Started by [email protected], July 18, 2023, 09:07:40 AM

Previous topic - Next topic

[email protected]

Hi All,

I have 2 PI devices where Mosquitto is running and I want to use one Windows machine with NetXMS agent, SubAgent MQTT to subscribe and collect the data.

In both PI devices, i can see in Mosquitto logs that NetXMS agent is logging succesfully. The nxagentd.conf file is configured to connect to 2 MQTT brokers and collect few Metrix..

The problem is that successful collection is happening only to one broker: if I put connection/Metrics of any of the brokers, everything goes fine. When I put connection/Metrics of both brokers, successful collection of DCI values is on the first one only, second shows errors.
In documentation it shows that you can subscribe to more than one broker, on same agent. Any idea how to do this?


MasterServers = <IP address of NetXMS server>
ConfigIncludeDir = C:\NetXMS\etc\nxagentd.conf.d
LogFile = {syslog}
FileStore = C:\NetXMS\var
SubAgent = mqtt

[MQTT/Brokers/pi_cz_gen]
Hostname = <here I'm putting IP address of MQTT broker>
Port = 1883
Login = admin
Password = *******

[MQTT/Brokers/pi_cz_gen/Metrics]
CZ_GEN.Telemetry.Battery = "tele/cz-gen/Battery"
CZ_GEN.Telemetry.Status = "tele/cz-gen/Status"

[MQTT/Brokers/pi_cf_gen]
Hostname = <here I'm putting IP address of MQTT broker>
Port = 1883
Login = admin
Password = ******

[MQTT/Brokers/pi_cf_gen/Metrics]
CF_GEN_3.Telemetry.GEN_CF_3_Battery = "tele/cf-gen/GEN_CF_3_Battery"
CF_GEN_3.Telemetry.GEN_CF_3_Frequency = "tele/cf-gen/GEN_CF_3_Frequency"
CF_GEN_3.Telemetry.GEN_CF_3_TotalPower = "tele/baa352c08d7f501c/GEN_CF_3_TotalPower"

Victor Kirhenshtein

Configuration is correct, so it looks like a bug in agent (or libmosquitto). I will try to reproduce it in the lab.

Best regards,
Victor