Navigation

    Kopano
    • Register
    • Login
    • Search
    • Categories
    • Get Official Kopano Support
    • Recent
    Statement regarding the closure of the Kopano community forum and the end of the community edition

    show concurrent users with min. / max. in history

    Kopano Groupware Core
    3
    4
    262
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • micro
      micro last edited by

      Hi all,

      is it somehow possible to show the total amount of users currently connected to the server? I am also interested in displaying the peaks (min/max).

      thank you.

      1 Reply Last reply Reply Quote 0
      • klausade
        klausade last edited by

        You could use these commands for some:
        kopano-stats --top
        z-push-top

        And have a look at kopano-stats --help

        1 Reply Last reply Reply Quote 1
        • jengelh
          jengelh Banned last edited by

          Sounds like a case for kopano-statsd.

          1 Reply Last reply Reply Quote 0
          • micro
            micro last edited by

            Hi,

            I just tried out.

            When I run “kopano-stats --top” I realize following:

            • the column APP shows for most of our users OUTLOOK.EXE// but they are not using Outlook. This seems to be a wrong detection?
            • you can only see as much lines as the height of your display permits. All other below are cut and not shown. Sorting with a-h does not help either.

            ==> this command seems not helpful for this task.

            By using “kopano-stats --session --dump” I get a quite helpful output. I modified the command and ended up into:

            kopano-stats --session --dump | grep -v SYSTEM |awk -F';' '!a[$7]++ {if (NR!=1) print $7}' |sort -u |uniq |tee >(wc -l)
            

            which will output all currently logged in users and outputs also the number of total users at the end of the output (just 4 ensuring the output is correct)

            Going further, I modified this one-liner and I run the command each 5min on my Kopano-server by a cron job.

            $ crontab -l
            
            */5 * * * * /usr/local/bin/kopano-getUserSessions.sh
            

            It will get the total numbers of Kopano user sessions and write them into a logfile.

            $ cat /usr/local/bin/kopano-getUserSessions.sh
            
            #!/bin/bash
            out=/var/log/kopano/minmax-users.log
            kopano-stats --session --dump | grep -v SYSTEM |awk -F';' '!a[$7]++ {if (NR!=1) print $7}' |sort -u |uniq |wc -l >>$out
            

            The following perl program does read all the lines of the previous mentioned log file and output the min/max values.

            $ cat /usr/local/bin/kopano-MinMaxUsers.pl
            
            #!/usr/bin/perl
            $min = 999;
            $max = 0;
            while (<>) {
             $max = $_ if ($_ > $max);
             $min = $_ if ($_ < $min);
            }
            print "Kopano user sessions:\n=====================\nMIN=$min\nMAX=$max";
            

            Whenever I want to read the min/max values of this log file I just execute this command

            kopano-MinMaxUsers.pl /var/log/kopano/minmax-users.log
            
            

            and the output is something like:

            Kopano user sessions:
            =====================
            MIN=18
            
            MAX=62
            
            

            Thank you all.

            1 Reply Last reply Reply Quote 1
            • First post
              Last post