Erlang/OTP Forums

Author Message

<  Ejabberd mailing list  ~  ejabberd status monitoring bot.

Guest
Posted: Sat Sep 02, 2006 10:12 pm Reply with quote
Guest
Is there a way in ejabberd to send an admin a copy of all presence packets?

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).

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).

Any pointers would be greatly appreciated.

Thanks,

-- Yermo

----------------------------------------------------------------------------
DTLink Software http://www.dtlink.com
Business and Finance Software Engineering
----------------------------------------------------------------------------

_______________________________________________
ejabberd mailing list
ejabberd@jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd
Post recived from mailinglist
Guest
Posted: Mon Sep 04, 2006 10:42 am Reply with quote
Guest
2006/9/3, Yermo Lamers <yml@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.


--
_______________________________________________
ejabberd mailing list
ejabberd@jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd
Post recived from mailinglist
Guest
Posted: Mon Sep 04, 2006 6:20 pm Reply with quote
Guest
>> 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.

Oh that's a good point. I hadn't thought about 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.

I was really hoping not to have to modify the server. Our big concern with
modifying the server is then maintaining the modifications as the server
matures. But maybe it can't be helped.

The problem with reports and statistics is they constantly change as you
come up with new business questions. This would imply a more generalized
and flexible approach might be more appropriate. I forsee needing to
update these reports quite often as we run our project.

How difficult would it be to add the sessions and muc_rooms tables to the
Mysql backend?

>> 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.

I think a bot might be easier to maintain since the server is a moving
target. At least that's my thinking.

Thanks for the pointers. I think that gives me what I need to get started
with.

----------------------------------------------------------------------------
DTLink Software http://www.dtlink.com
Business and Finance Software Engineering
----------------------------------------------------------------------------

_______________________________________________
ejabberd mailing list
ejabberd@jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd
Post recived from mailinglist
Guest
Posted: Mon Sep 04, 2006 8:54 pm Reply with quote
Guest
>> 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.

I've been taking a look at the mod_logxml module which seems to already do
almost everything I want.

Is there any reason why I couldn't just add a call to
ejabberd_router:route() at the end of send_packet() and receive_packet()
to forward the packets I'm interested in to a configured JID?

Seems like it might make for a nice addition.

----------------------------------------------------------------------------
DTLink Software http://www.dtlink.com
Business and Finance Software Engineering
----------------------------------------------------------------------------

_______________________________________________
ejabberd mailing list
ejabberd@jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd
Post recived from mailinglist

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum