I just want to know how many clients are actively connected to my mosquitto server. Or even better, get a list of client ids connected to my mosquitto server. I read some documentation suggesting the topic $SYS/broker/clients/connected
will give this information. But this command yielded no response and no results:
mosquitto_sub -h myserver.myserver.myserver -p 9500 -t $SYS/broker/clients/connected -u "my-user" -P "my-password" --capath /etc/ssl/certs/
(I replaced myserver.myserver.myserver
and my-user
and my-password
with actual values.) I verified the connection is working because if I publish a message to the same topic, the message appears.
How can I get a list of clients with active connection to my mosquitto server? Or at least a numeric count of active connections?