Monday, 17 January 2011

Adding Modules to Ejabberd Installation, Linux Statsdx

Ejabberd XMPP messaging server comes with a few modules with the initial installation. Some of these are useful however you can extend the features of the server a lot more by using additional modules.

There are a number of modules that can be downloaded from https://svn.process-one.net/ejabberd-modules/  , also there are a number of custom modules on the net, or you can even write your own; if you know erlang.

For example if you wanted some more useful user statistics for your server, rather than just the basic Statistics tab from the web admin page, that just gives you the following details:

Registered Users
Online Users
Outgoing s2s Connections
Outgoing s2s Servers

Why not install the statsdx module that gives you a lot more information.

All modules are installed into the /opt/ejabberd-2.1.5/lib/ejabberd-2.1.5/ebin directory however each module will have it's own set-up requirements written in the README.txt available in each module trunk directory.

To install statsdx :

change to /opt/ejabberd-2.1.5/lib/ejabberd-2.1.5 directory

run svn co https://svn.process-one.net/ejabberd-modules/ to get the latest modules

cd ejabberd-modules/mod_statsdx/trunk


run ./build.sh

copy generated beam file(s) from trunk/ebin directory to
/opt/ejabberd-2.1.5/lib/ejabberd-2.1.5/ebin


edit /opt/ejabberd-2.1.5/conf/ejabberd.cfg:

Scroll down to the section headed modules, this is where you enable each module on your server.


Append the following the the end of the enable modules:

{mod_statsdx, [{hooks, true}]}
(as instructed in the README.txt available with the module src files)

run ./opt/ejabberd-2.1.5/bin/ejabberdctl restart to restart the server instance

Browse to http://localhost:5280/admin/ to see you have more stats available under the Statistics DX tab, such as:

Registered Users
Roster Details
User details
MUC information
Sessions per client, OS, connection type, Languages

There are a lot more modules you can use to extend your basic Ejabberd installation, depending on what you want to do or know.

2 comments: