As a mqtt client connected to mosquitto is it possible to retrieve a list of client IDs who are also connected to the broker?
You could presumably get this information via the BASH commands netstat, grep and if necessary awk. If Mosquitto is using port 1883 then the following will tell you what you want I believe:
sudo netstat | grep :1883