[ejabberd] ejabberd status monitoring bot.

Badlop badlop at gmail.com
Mon Sep 4 14:41:32 MSD 2006


2006/9/3, Yermo Lamers <yml at dtlink.com>:

> What I would like to do is built a ejabberd monitoring bot that would keep
> an updated list of all currently connected users. (Imagine a nice GUI with
> a list of all currently connected users with length of time connected,
> etc).

The online users are already tracked on the database, table 'session'.
ejabberd provides hooks called user_login and user_logout that report
the JID. The list of currently connected users is already available on
the webinterface and on Jabber Discovery.

With all this, it looks quite easy to write a simple module that keeps
track of user logins and logouts on memory, and a patch for the
webinterface to show that information on the current user page.


> In addition, I'd also like to be able to track all currently established
> conferences. (Further imagine a nice GUI with all conferences and
> participants displayed).

Persistent chatrooms are tracked on the database table 'muc_room', and
even the non-persistent are tracked at ETS table 'muc_online_room'.
However, the participants, their affiliations, etc, is stored on
variables in the module mod_muc_room.

Maybe it's possible to write a patch for mod_muc_room to export a new
function: get_list_participants(Room). And then, a patch for the
webinterface to query this function and show the results.


> Is there a way in ejabberd to send an admin a copy of all presence packets?
> Any pointers would be greatly appreciated.

However, if you prefer the independent bot, it's also possible to
write a small module that listens the interesting hooks and sends
jabber messages or xmpp packets to the JID you configure.


--


More information about the ejabberd mailing list