[JDEV] How to get current number of users?

lukasm lukasm at wp-sa.pl
Wed Jan 22 08:14:59 CST 2003

Sylvain Roberdeau wrote:

>    I'm looking for a way to get current number of connected users for a
>stat service and RRD Tools.
>    First, I thought that an admin command  or an jabberd module exist.
>    Before create a specific module, I would like to know if there is an
>existing way to do that.
>    Thanks for the anwser
Add this in users.c in js_users_gs after ghash_walk.
si->stats_file can be configured in jsm.c or you may set it constant.

    if (si->stats_file) {
      FILE *plik;
      plik = fopen(si->stats_file, "w");
      if (plik) {
        fprintf(plik, "%d\r\n", js__usercount);
      else {
        log_debug(ZONE,"Error opening log file");

More information about the JDev mailing list