Search code examples
sessionmqttmosquitto

Is there a way to know (persitents) client sessions on a mqtt server? - Mosquitto


I need to know how many and which peristent session are active on a mqtt server. I think it's out of standard and different mqtt servers have different implementation. I'm using mosquitto version 2.0.17 Clients are using v5 protocol and cleanSession = false

I try subscribing at $SYS but it only show me the number/state of connections, not the session name mosquitto with mqtt explorer


Solution

  • I think the solution is to check the log files, stored fisically on mosquitto server.

    Probably using some shell command you can periodically loop on that file(s) and do a publish on a retained topic with the name of the connected client.

    I think this link can help mosquitto-logging