ejabberd administration from command-line, XMPP client, and more
ProcessOne - Nicolas Vérité - September 23, 2009ejabberd has a powerful set of commands for administrative purposes that you can use on the command-line or your standard XMPP client.
ejabberd provides two handy administration interfaces to execute commands:
- ejabberdctl command line script: for use in your regular terminal or via SSH
- Ad-Hoc Commands (XEP-0050): for use in your regular standard XMPP client
You can get the full list of available commands by launching the ejabberdctl command list script when ejabberd is running. For example, in ejabberd 2.1.0, you have those commands:
$ ejabberdctl
Usage: ejabberdctl [--node nodename] [--auth user host password] command [options]
Available commands in this ejabberd node:
backup file Store the database to backup file
connected_users List all established sessions
connected_users_number Get the number of established sessions
delete_expired_messages Delete expired offline messages from database
delete_old_messages days Delete offline messages older than DAYS
dump file Dump the database to text file
dump_table file table Dump a table to text file
export_piefxis dir Export data of all users in the server to PIEFXIS files (XEP-0227)
export_piefxis_host dir host Export data of users in a host to PIEFXIS files (XEP-0227)
get_loglevel Get the current loglevel
help [--tags [tag] | com?*] Show help (try: ejabberdctl help help)
import_dir file Import users data from jabberd14 spool dir
import_file file Import user data from jabberd14 spool file
import_piefxis file Import users data from a PIEFXIS file (XEP-0227)
incoming_s2s_number Number of incoming s2s connections on the node
install_fallback file Install the database from a fallback file
load file Restore the database from text file
mnesia [info] show information of Mnesia system
mnesia_change_nodename oldnodename newnodename oldbackup newbackup Change the erlang node name in a backup file
outgoing_s2s_number Number of outgoing s2s connections on the node
register user host password Register a user
registered_users host List all registered users in HOST
rename_default_nodeplugin Update PubSub table from ejabberd trunk SVN to 2.1.0
reopen_log Reopen the log files
restart Restart ejabberd
restore file Restore the database from backup file
status Get ejabberd status
stop Stop ejabberd
unregister user host Unregister a user
user_resources user host List user's connected resources
Examples:
ejabberdctl restart
ejabberdctl --node ejabberd@host restart
Commands to start an ejabberd node:
start Start an ejabberd node in server mode
debug Attach an interactive Erlang shell to a running ejabberd node
live Start an ejabberd node in live (interactive) mode
You also have access to all these commands with any standard XMPP client that supports Ad-Hoc Commands, and XEP-0004: Data Forms. Of course your Jabber account must have admin privilege in ejabberd to execute the commands.

The dialog box for Ad-Hoc Commands, and below, the list of available commands:

In addition to the ejabberdctl script and the XMPP client interface, you can execute commands in several other ways if you install the corresponding modules:
- ejabberd_xmlrpc allows XML-RPC calls
- mod_rest allows HTTP POSTs
- mod_shcommands provides a new page in ejabberd’s WebAdmin
- service discovery
Here is the service discovery under Psi+:

Here is there ejabberd’s WebAdmin interface:

And finally, you can install mod_admin_extra, which provides many more commands for specific tasks, like modify roster, vCard, and shared roster groups. There is also mod_muc_admin, which provides commands to administer the MUC service: create, destroy, list, configure rooms…
Note: the concepts and features described in this post apply to ejabberd 2.1.0 and newer. Older versions do not include all the commands described here.
Categories: Companies ProcessOne
Comments
No comments so far, you could be the first.Add comment
Erlang on Twitter
» TigerHasse (Hans Sterby): Bryan Hunter and OJ Reeves Program in Erlang. http://t.co/gUFUkaZa #erlang #dotnetrocks
» mellyameel (desyifa kamelia): pelit bgt deh @doni_erlang
» doni_erlang (Dony Erlangga): MALAS :p haha RT @mellyameel: fotoin gue please @doni_erlang @lisamariyani @SyaftoWibowo @ekrii :D
» Expatclic (Expatclic ): Programmatori Erlang cercasi per lavoro a Sofia, Berlino o Budapest. Contattaci per maggiori info: contact@expatclic.com
» bagus_erlang (bagus): Zzzzz..
» mellyameel (desyifa kamelia): fotoin gue please @doni_erlang @lisamariyani @SyaftoWibowo @ekrii :D
» MQuotient (MQuotient Solutions): Great start to seminars at MQ. Started with Fundamentals of statistics, Concurrency with Erlang, Python tricks and Advanced Git
» a2zmax (這いよれ!あずまっくす): RT @matsumotory: erlang入れるのに、久々にepel使ってる
» matsumotory (MATSUMOTO, Ryosuke): erlang入れるのに、久々にepel使ってる
» csanz (Christian Sanz): earlang community is kinda weak ATM http://t.co/pJCU5TSY
Statistics
Number of aggregated posts: 10504
Number of comments: 2145
Most recent article: May 21, 2012
Latest comments
» sunshine on We Who Value Simplicity Have Built Incomprehensible Machines: How to Get Free Credit Scores Having good credit is imperative in today’s world. There are so many things you…
» cheap stickers printings on A Forgotten Principle of Compiler Design: I really like your way of expressing the opinions and sharing the information. It is good to move as chance…
» jamesmathew on This is Why You Spent All that Time Learning to Program: This could be a good achievement for the small area to have a personal news channel and could really help…