diff --git a/rel/files/emqttd_ctl b/rel/files/emqttd_ctl index f98a3da66..41f6d0433 100755 --- a/rel/files/emqttd_ctl +++ b/rel/files/emqttd_ctl @@ -242,6 +242,45 @@ case "$1" in exit 1 fi ;; + clients) + # Make sure the local node IS running + RES=`$NODETOOL ping` + if [ "$RES" != "pong" ]; then + echo "emqttd is not running!" + exit 1 + fi + if [ $# -eq 2 -a $2 = "list" ]; then + $NODETOOL rpc emqttd_ctl clients list + elif [ $# -eq 3 ]; then + shift + $NODETOOL rpc emqttd_ctl clients $@ + else + echo "Usage: " + echo "$SCRIPT clients list" + echo "$SCRIPT clients show " + echo "$SCRIPT clients kick " + exit 1 + fi + ;; + sessions) + # Make sure the local node IS running + RES=`$NODETOOL ping` + if [ "$RES" != "pong" ]; then + echo "emqttd is not running!" + exit 1 + fi + if [ $# -eq 2 -a $2 = "list" ]; then + $NODETOOL rpc emqttd_ctl sessions list + elif [ $# -eq 3 ]; then + shift + $NODETOOL rpc emqttd_ctl sessions $@ + else + echo "Usage: " + echo "$SCRIPT sessions list" + echo "$SCRIPT sessions show " + exit 1 + fi + ;; plugins) # Make sure the local node IS running RES=`$NODETOOL ping` @@ -309,6 +348,12 @@ case "$1" in echo " metrics #query broker metrics" echo " cluster [] #query or cluster nodes" echo " ----------------------------------------------------------------" + echo " clients list #list all clients" + echo " clients show #show a client" + echo " clients kick #kick a client" + echo " session list #list all sessions" + echo " session show #show a sessions" + echo " ----------------------------------------------------------------" echo " plugins list #query loaded plugins" echo " plugins load #load plugin" echo " plugins unload #unload plugin"