Room List Tool

— Version 2 —
(Please see latest posts of this thread, there may be a newer version.)

There are several ways to get a list of currently existing conference rooms. One of them is based on Magic_V’s idea who demonstrated impressively that it is possible to retrieve all necessary information by analysing one of Jitsi’s log files ( Log Based Monitoring Approach ).
To do this, you can use the C program ‘jitsiroomlist’ which inspects the regarding log file and writes both, a list of currently opened rooms and a log of rooms which existed in the past.

Example of room list:

Jitsi Room list (creation_time room_name [owner] member_count)

2020-04-23_14:02:10 room1 [me] 2
2020-04-23_14:05:58 someroom [ben] 5
2020-04-23_14:09:25 nowhere [ben] 3

Example of room log:

2020-04-23_13:50:33 2020-04-23_13:41:42 someroom [me] 2
2020-04-23_14:20:01 2020-04-23_14:02:10 room1 [me] 4
2020-04-23_14:20:11 2020-04-23_14:05:58 someroom [ben] 5
2020-04-23_14:20:17 2020-04-23_14:09:25 nowhere [ben] 3

(termination time, creation time, room name, [owner name], max. number of participants)

Both files can be made accessible via www – secured by .htpasswd, if you want:
yourdomain.org/rooms.txt and yourdomain.org/roomslog.txt
This is a little how-to guide (no warranty):

Prerequisites

Let’s assume you have already installed Jitsi Meet Server on a Linux machine, operating system Ubuntu 19.10, for example. Let’s further assume you have chosen an easy security concept and are logged in as ‘root’.

Install jitsiroomlist program

Well, there is no actual “installing”, you just copy the program’s source file to /root directory and compile it. Then you write a small shell script to automatically start and restart the program, including some log rotation.
Let’s do this step by step: Open a shell via SSH and log in as user ‘root’. If you cannot log in as ‘root’ but have another user account with administrator privilege, switch to ‘root’ via “sudo su -”.
Enter this command to open a nano editor window:

nano /root/jitsiroomlist.c

Now insert the whole source by copy-and-paste: Click on jitsiroomlist.c.txt (13.6 KB) to open, then copy all by pressing Ctrl-a, Ctrl-c, switch to your server’s nano editor window and press Ctrl-Shift-v to insert. After this, press Ctrl-o to write the file and Ctrl-x to exit.
Now compile the source:

gcc /root/jitsiroomlist.c -o /root/jitsiroomlist

To start the newly created program jitsiroomlist we need to enter a script:

nano /root/jitsiroomlist.sh

Insert insert these lines by using copy-and-paste:

if [ ""$1 != "restart" ]; then
 sleep 20
else
  killall -q jitsiroomlist
  cat /usr/share/jitsi-meet/rooms.txt >>/usr/share/jitsi-meet/roomslog.txt 2>/dev/null
  cat /usr/share/jitsi-meet/roomslog.txt >>/var/log/jitsi/rooms.log.1 2>/dev/null
  echo "" >/usr/share/jitsi-meet/roomslog.txt
  mv -f /var/log/jitsi/jicofon.log /var/log/jitsi/jicofon.log.1 2>/dev/null
  /root/jitsiroomlist &
fi
/root/jitsiroomlist /usr/share/jitsi-meet/rooms.txt /usr/share/jitsi-meet/roomslog.txt </var/log/jitsi/jicofo.log >>/var/log/jitsi/jicofon.log &

Now the same procedure: Ctrl-o, Ctrl-x
Make the script file executable:

chmod a+x /root/jitsiroomlist.sh

Chain-in jitsiroomlist program

The new program needs to inspect each logfile line of “jicofo.log” as soon as it is being written. For this purpose we have to replace the actual file by a so-called named pipe. This pipe will be fed by Jitsi procedures and read by jitsiroomlist program.

service jicofo stop
rm -f /var/log/jitsi/jicofo.log*
mkfifo /var/log/jitsi/jicofo.log
chown jicofo:jitsi /var/log/jitsi/jicofo.log
service jicofo start

Schedule start of jitsiroomlist program

jitsiroomlist program shall be started at boot time and restarted once a week. The latter is necessary because otherwise the new Jicofo log file “jicofon.log” would grow indefinitely.

echo "@reboot root /root/jitsiroomlist.sh" >/etc/cron.d/jitsiroomlist
echo "0 5 * * 1 root /root/jitsiroomlist.sh restart" >>/etc/cron.d/jitsiroomlist
service cron restart

Limit access to room list

It might be a good idea to allow only privileged users to access room list and room-list log. The following example uses XXXX as placeholder for your domain, and ROOMLISTUSER as placeholder for the privileged user.

apt install apache2-utils
htpasswd -c /etc/nginx/.htpasswd ROOMLISTUSER
nano /etc/nginx/sites-available/XXXX.conf

Scroll down to the end of this file and insert these two lines right above the last bracket:

location = /rooms.txt { auth_basic "Who?"; auth_basic_user_file /etc/nginx/.htpasswd; }
location = /roomslog.txt { auth_basic "Who?"; auth_basic_user_file /etc/nginx/.htpasswd; }

Restart your server

reboot
1 Like

Hello, I just passed the complete installation procedure for the room list tool. Calling myjitsiserver.at/rooms.txt login works but ends up in an 404 not found error. Calling myjitsiserver.at/roomslog.txt the screen remains blank.
Install steps performed as root exactly how described. The compilation of jitsiroomlist.c ended with “ok”. In var log the jicofo.log ist missing, jicofon.log is empty. A second jicofon.log1 (produced by an extra reboot) is empty. A rooms.log1 is empty. no other rooms.log there. Is there a possibility to temporarily keep the jicofo.log? Your kind advice to solve the problem would greatfully be appreciated. Thank you in advance Toni
PS: Ubuntu 18.04 server is used.

Hi toni,
thanks for the the hint! I should add to the description that rooms.txt will not exist until the first room has been created, and roomslog.txt will not exist until the first room has been closed.

I am puzzled about the logs… Could you please send me the result of this command?
ls -l /var/log/jitsi

Yes, please:
root@toni:/home/toni# ls -l /var/log/jitsi
insgesamt 26572
prw-r–r-- 1 jicofo jitsi 0 Apr 27 15:52 jicofo.log
-rw-r–r-- 1 jicofo jitsi 1908031 Apr 27 06:25 jicofo.log.1
-rw-r–r-- 1 jicofo jitsi 75388 Apr 26 06:25 jicofo.log.2.gz
-rw-r–r-- 1 jicofo jitsi 55522 Apr 25 06:25 jicofo.log.3.gz
-rw-r–r-- 1 jicofo jitsi 58061 Apr 24 06:25 jicofo.log.4.gz
-rw-r–r-- 1 jicofo jitsi 76512 Apr 23 06:25 jicofo.log.5.gz
-rw-r–r-- 1 jicofo jitsi 97177 Apr 22 06:25 jicofo.log.6.gz
-rw-r–r-- 1 jicofo jitsi 152792 Apr 21 06:25 jicofo.log.7.gz
-rw-r–r-- 1 root root 0 Apr 27 16:42 jicofon.log
-rw-r–r-- 1 root root 0 Apr 27 16:03 jicofon.log.1
drwxr-xr-x 4 jigasi jitsi 4096 Apr 19 20:15 jigasi
-rw-r–r-- 1 jigasi jitsi 2092619 Apr 27 18:14 jigasi.log
-rw-r–r-- 1 jvb jitsi 22665277 Apr 27 18:57 jvb.log
-rw-r–r-- 1 root root 0 Apr 27 16:42 rooms.log.1
dir

Hi Toni,

it seems the named pipe has not been created successfully. Please try:

service jicofo stop
rm -f /var/log/jitsi/jicofo.log*
mkfifo /var/log/jitsi/jicofo.log
chown jicofo:jitsi /var/log/jitsi/jicofo.log
service jicofo start

Then ensure that the pipe has been created:
ls -l /var/log/jitsi
should show the pipe (marked “p” on the left):

...
prw-r--r--  1 jicofo jitsi        0 Apr 27 19:21 jicofo.log|
...

If this has worked, please reboot.

Good evening Marqqs,
thank you for your immediate help and support. I followed the steps advised and the properties of jicofo.log are now as required. It seems it did not help.
https://meeting.optikerkoller.at/rooms.txt
Error 404
https://meeting.optikerkoller.at/roomslog.txt
The password requester appears, after setting user and password: blank screen.
(BTW: I reset user and password with: htpasswd -c /etc/nginx/.htpasswd toni)
However, I normally do have to log in as “Organizer” to start a meeting…

Please start a meeting and then end it. It does not matter if you are alone in that meeting. Afterwards, there should be no 404.

If there is still an error, please show me the new result of ls -l:

ls -l /var/log/jitsi

Cleared browser cache, rebooted and logged into a room “123” and endet. Sad enough, no change. Here is the list:
root@toni:/home/toni# ls -l /var/log/jitsi
insgesamt 24544
prw-r–r-- 1 jicofo jitsi 0 Apr 27 19:37 jicofo.log
-rw-r–r-- 1 root root 0 Apr 27 16:42 jicofon.log
-rw-r–r-- 1 root root 0 Apr 27 16:03 jicofon.log.1
drwxr-xr-x 4 jigasi jitsi 4096 Apr 19 20:15 jigasi
-rw-r–r-- 1 jigasi jitsi 2226331 Apr 27 20:23 jigasi.log
-rw-r–r-- 1 jvb jitsi 22888640 Apr 27 20:44 jvb.log
-rw-r–r-- 1 root root 0 Apr 27 16:42 rooms.log.1
root@toni:/home/toni#

Regards Toni

Looks good now, the pipe exists. :slight_smile:

Did you reboot?
Is the program jitsiroomlist running?

ps -ef | grep jitsiroomlist
ls -l /root/jitsiroomlist*
cat /root/jitsiroomlist.sh

Hello Marqqs, sorry for the late response but the wife was reasoning…Here is the output:
root@toni:/home/toni# ps -ef | grep jitsiroomlist
root 22561 22512 0 13:34 pts/0 00:00:00 grep --color=auto jitsiroomlist
root@toni:/home/toni# ls -l /root/jitsiroomlist*
-rw-r–r-- 1 root root 13659 Apr 27 11:27 /root/jitsiroomlist.c
-rwxr-xr-x 1 root root 537 Apr 27 11:32 /root/jitsiroomlist.sh
root@toni:/home/toni# cat /root/jitsiroomlist.sh
if [ “”$1 != “restart” ]; then
sleep 20
else
killall -q jitsiroomlist
cat /usr/share/jitsi-meet/rooms.txt >>/usr/share/jitsi-meet/roomslog.txt 2>/dev/null
cat /usr/share/jitsi-meet/roomslog.txt >>/var/log/jitsi/rooms.log.1 2>/dev/null
echo “” >/usr/share/jitsi-meet/roomslog.txt
mv -f /var/log/jitsi/jicofon.log /var/log/jitsi/jicofon.log.1 2>/dev/null
/root/jitsiroomlist &
fi
/root/jitsiroomlist /usr/share/jitsi-meet/rooms.txt /usr/share/jitsi-meet/roomslog.txt </var/log/jitsi/jicofo.log >>/var/log/jitsi/jicofon.log &
It seems ok and running but still the same result :frowning:
Regards Toni

Hi Toni,
no problem, I completely understand this kind of situation, she has priority. :slight_smile:

No, it is not. It looks like “running”, but what you see is just the process of your grep enquery.
If jitsiroomlist process was running, you would have got a result like this:

root     13568     1  0 Apr27 ?        00:00:01 /root/jitsiroomlist /usr/share/jitsi-meet/rooms.txt /usr/share/jitsi-meet/roomslog.txt
root     28008 27991  0 13:47 pts/0    00:00:00 grep --color=auto jitsiroomlist

Please check crontab entries:

crontab -e

Scroll to the end of the table. You should see these two lines (if not, please enter them):

@reboot /root/jitsiroomlist.sh
0 5 * * 1 /root/jitsiroomlist.sh restart

Then restart cron service and reboot:

service cron restart
reboot

Hello Marqqs,

thank you for your reply. After reboot same result. However I
found something strange regarding the crontab file. Editing “a”
crontab file as supposed, a complete empty file appears.
Wondering, that this file did not contain anything I “nano
/etc/crontab” and found a different file with the entries required
missing. They have been added and the output seems to be ok now,
but- no change in the result, still the same error… Here is the
log after setting the proper entries in the “real” crontab… and
reboot

T.

ps -ef | grep jitsiroomlist
ls -l /root/jitsiroomlist*
cat /root/jitsiroomlist.sh

root@toni:/home/toni# ps -ef | grep jitsiroomlist
root 12123 12112 0 15:28 pts/0 00:00:00 grep --color=auto jitsiroomlist
root@toni:/home/toni# ls -l /root/jitsiroomlist*
-rw-r–r-- 1 root root 13659 Apr 27 11:27 /root/jitsiroomlist.c
-rwxr-xr-x 1 root root 537 Apr 27 11:32 /root/jitsiroomlist.sh
root@toni:/home/toni# cat /root/jitsiroomlist.sh
if [ “”$1 != “restart” ]; then
sleep 20
else
killall -q jitsiroomlist
cat /usr/share/jitsi-meet/rooms.txt >>/usr/share/jitsi-meet/roomslog.txt 2>/de v/null
cat /usr/share/jitsi-meet/roomslog.txt >>/var/log/jitsi/rooms.log.1 2>/dev/nul l
echo “” >/usr/share/jitsi-meet/roomslog.txt
mv -f /var/log/jitsi/jicofon.log /var/log/jitsi/jicofon.log.1 2>/dev/null
/root/jitsiroomlist &
fi
/root/jitsiroomlist /usr/share/jitsi-meet/rooms.txt /usr/share/jitsi-meet/roomsl og.txt </var/log/jitsi/jicofo.log >>/var/log/jitsi/jicofon.log &

Hi Toni, you are right, seems to be some confusion with crontab.

How did you login as root? Directly? Or did you switch to root by sudo su? In case of sudo, it is important to add a minus at the end:

sudo su -

Otherwise you will not get the environment of user root and therefore not edit root’s crontab but possibly your own.

To check the contents of crontab please enter these commands:

sudo su -
crontab -l
exit

Btw., what is the result?

Hi Marqqs,

sudo su – and crontab -e leads to the crontab which appears empty except the entries made shortly.

This one resides in /var/spool/cron/crontabs, filename root. The one containing the other stuff resides in /etc/. According to Ubuntu howto “personal” crontab entries should be placed in /var/spool/cron/crontabs. However, I just learned that the entry has to be followed by a newline entry which I amended of course. There is no relevant entry in cron.d. Creating a symbolic link from /var/spool/cron/crontabs/root into cron.d did not change the situation.

Regards

Toni

I’ve just looked into my /var/spool/cron/crontabs/root and found the two jitsiroomlist lines.
Works fine on both servers of mine. Not sure why this does not work on yours. :frowning:

Lets try a different approach: Please delete all previously made entries for jitsiroomlist in all crontabs. Then enter these commands:

echo -e "@reboot root /root/jitsiroomlist.sh\n0 5 * * 1 root /root/jitsiroomlist.sh restart">/etc/cron.d/jitsiroomlist
service cron restart
reboot

This will create a user-independent entry in /etc/cron.d

Stop…
I think I’ve overlooked one detail: Did you compile the source?

gcc /root/jitsiroomlist.c -o /root/jitsiroomlist

Hello! Some additional information:

  • Please note that any access to https://XXXX/rooms.txt is not possible until the first room has been created.
  • The tool has now been successfully tested with Jitsi on Ubuntu 20.04.

Hi @Marqqs!
Wonderfull solution!

Is there a way to add code for list autenticated users like the creator to show it in the rooms.txt? I dont know C programming language and I want to show when a room is being recordered… so I want to add the feature to show Jibri user in the list. The jibri user is always the same so can you explain how to modify code to add a line showing when Jibriuser join de room?

thnks!

hi Marqqs,
I get this error:
gcc /root/jitsiroomlist.c -o /root/jitsiroomlist
/usr/lib/gcc/x86_64-linux-gnu/7/…/…/…/x86_64-linux-gnu/Scrt1.o: In function _start': (.text+0x20): undefined reference to main’
collect2: error: ld returned 1 exit status
so, how to fix it?
thanks

Hello and thanks!

If you have activated “secure domain”, the creator of the room will be displayed in brackets in the room list. Example:

2020-04-23_14:20:11 2020-04-23_14:05:58 someroom [ben] 5

Or did you mean a list of all people who are allowed to create rooms?

Hi @Marqqs!

I have the solution installed and running, and I can see the rooms being created and the creator listed inside brackets. What I need is to add code to detect when a room is being recordered.

I have implemented a standard jibri solution for record rooms. When the jibri joins the room it allways does with the same name and jicofo logs some lines with thata of the join and record. So, can you modify the code to detect that situation to inform when a room is being recroded?
I can post the lines that jibri write in the log

Thanks!