Please support printing the number of active users with prosodyctl, comparable to how ejabberdctl does this:
num-active-users [host] [days]
Print number of users registered on the virtual host [host] who
logged on the server at least once during the last days [days].
Thank you for the hint!
Unfortunately the unmodified mod_list_inactive doesn't work on my setup:
Failed to execute command: Error: /usr/local/lib/prosody modules/mod_list_inactive.lua:42: attempt to call a nil value
stack traceback:
/usr/lib/prosody/core/modulemanager.lua:29: in function '(for generator)'
/usr/local/lib/prosody modules/mod_list_inactive.lua:42: in function </usr/local/lib/prosody modules/mod_list_inactive.lua:21>
(tail call): ?
[C]: in function 'xpcall'
/usr/lib/prosody/core/modulemanager.lua:29: in function </usr/lib/prosody/core/modulemanager.lua:26>
(tail call): ?
/usr/bin/prosodyctl:809: in main chunk
[C]: ?
Is it only working with internal users and not with users from LDAP?
Zash
on
It would work with the authentication modules that support listing users.
Dan
on
I'm using cyrus as authentication mechanism, so unfortunately listing users doesn't seem to be supported
Great, thank you very much!
There seems to be just one typo in line 45 of mod_list_active.lua:
Instead of
if last_active < max_age then
it should be
if last_active > max_age then
After this edit it works as expected. Thank you!
Please support printing the number of active users with prosodyctl, comparable to how ejabberdctl does this: num-active-users [host] [days] Print number of users registered on the virtual host [host] who logged on the server at least once during the last days [days].
There exists https://modules.prosody.im/mod_list_inactive.html which you should be easy to modify to suit your needs (s/inactive/active/, invert the condition, pipe output to wc -l).
Thank you for the hint! Unfortunately the unmodified mod_list_inactive doesn't work on my setup: Failed to execute command: Error: /usr/local/lib/prosody modules/mod_list_inactive.lua:42: attempt to call a nil value stack traceback: /usr/lib/prosody/core/modulemanager.lua:29: in function '(for generator)' /usr/local/lib/prosody modules/mod_list_inactive.lua:42: in function </usr/local/lib/prosody modules/mod_list_inactive.lua:21> (tail call): ? [C]: in function 'xpcall' /usr/lib/prosody/core/modulemanager.lua:29: in function </usr/lib/prosody/core/modulemanager.lua:26> (tail call): ? /usr/bin/prosodyctl:809: in main chunk [C]: ? Is it only working with internal users and not with users from LDAP?
It would work with the authentication modules that support listing users.
I'm using cyrus as authentication mechanism, so unfortunately listing users doesn't seem to be supported
This should do it: https://hg.prosody.im/prosody-modules/rev/39c39844cd4c
ChangesGreat, thank you very much! There seems to be just one typo in line 45 of mod_list_active.lua: Instead of if last_active < max_age then it should be if last_active > max_age then After this edit it works as expected. Thank you!
Right. https://hg.prosody.im/prosody-modules/rev/c06c59b99b3c