clients, sessions

This commit is contained in:
Feng Lee 2015-08-10 12:49:12 +08:00
parent 9e51fb3b24
commit e8dbe3b378
1 changed files with 45 additions and 0 deletions

View File

@ -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 <ClientId>"
echo "$SCRIPT clients kick <ClientId>"
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 <ClientId>"
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 [<Node>] #query or cluster nodes"
echo " ----------------------------------------------------------------"
echo " clients list #list all clients"
echo " clients show <ClientId> #show a client"
echo " clients kick <ClientId> #kick a client"
echo " session list #list all sessions"
echo " session show <ClientId> #show a sessions"
echo " ----------------------------------------------------------------"
echo " plugins list #query loaded plugins"
echo " plugins load <Plugin> #load plugin"
echo " plugins unload <Plugin> #unload plugin"