bigbluebutton

Check number of active meetings in Big Blue Button from command line


I want to check how many active meetings there are on the BBB server at any one time from the command line. I have tried

$ bbb-conf --network

but not getting anywhere. I have also checked the number of active connections to port 80 and 443

$ netstat -anp | grep :443 | grep ESTABLISHED | wc -l

but I'm not sure if I can trust that figure.

I know I can use the isMeetingRunning call from the API but I'm just looking for command line.

Any ideas would be appreciated


Solution

  • The following bash script, which can be run from command line on the same machine as the BigBlueButton server, will process the response to the BBB API getMeetings call.

    #!/bin/bash
    
    APICallName="getMeetings"
    APIQueryString=""
    
    X=$( bbb-conf --secret | fgrep URL: )
    APIEndPoint=${X##* }
    Y=$( bbb-conf --secret | fgrep Secret: )
    Secret=${Y##* }
    S=$APICallName$APIQueryString$Secret
    Checksum=$( echo -n $S | sha1sum | cut -f 1 -d ' ' )
    if [[ "$APIQueryString" == "" ]]
    then
            URL="${APIEndPoint}api/$APICallName?checksum=$Checksum"
    else
            URL="${APIEndPoint}api/$APICallName?$APIQueryString&checksum=$Checksum"
    fi
    wget -q -O - "$URL" | grep -o '<meetingID>' | wc -w
    

    Tested on a live BBB machine.

    Note: