Page 1 of 1

Users connected

PostPosted: Fri Apr 17, 2015 9:45 am
by phm
Hi,

Is there a command to know the connected users ?
And secondly, when I shutdown or run the OMERO server I have a mail from omero. However when I try to send mail to users via the web client The email does not arrive to its destination.


Philippe

Re: Users connected

PostPosted: Mon Apr 20, 2015 10:13 am
by jmoore
Hi Philippe,

phm wrote:Is there a command to know the connected users ?


In what context? E.g. from the CLI as the "root" OMERO user?


And secondly, when I shutdown or run the OMERO server I have a mail from omero. However when I try to send mail to users via the web client The email does not arrive to its destination.


What does the mail look like? Did you configure the new mail support? If so, can you share your configuration with us? Having the OMEROweb.log and Blitz-0.log from var/log for one failed attempt to send email would be useful.

Thanks,
~Josh.

Re: Users connected

PostPosted: Mon Apr 20, 2015 3:14 pm
by phm
jmoore wrote:Hi Philippe,

phm wrote:Is there a command to know the connected users ?

In what context? E.g. from the CLI as the "root" OMERO user?
In the web admin it will be nice, however in command line as an omero comand

And secondly, when I shutdown or run the OMERO server I have a mail from omero. However when I try to send mail to users via the web client The email does not arrive to its destination.


What does the mail look like? Did you configure the new mail support? If so, can you share your configuration with us?

Code: Select all
omero.mail.config=true
omero.mail.host=localhost
omero.mail.port=25
omero.web.admins=[["Philippe Mailly", "philippe.mailly@college-de-france.fr"]]

Having the OMEROweb.log and Blitz-0.log from var/log for one failed attempt to send email would be useful.
.[/quote]
Code: Select all
2015-04-17 11:24:55,290 INFO  [  o.cmd.mail.SendEmailRequestI.@2c3487c6] (erver-1144) Add callback: _`csq,SSt(-c(_#VgPN\//7a60f892-f12a-4dcd-827a-fef817f6950e
2015-04-17 11:24:55,291 INFO  [  o.cmd.mail.SendEmailRequestI.@2c3487c6] (erver-1145) getResponse: omero.cmd.SendEmailResponse@3f3e1c6b
2015-04-17 11:24:55,292 INFO  [  o.cmd.mail.SendEmailRequestI.@2c3487c6] (erver-1146) getStatus: omero.cmd.Status@6bbd53d
2015-04-17 11:24:55,294 INFO  [  o.cmd.mail.SendEmailRequestI.@2c3487c6] (erver-1144) Closing...
2015-04-17 11:24:55,294 INFO  [  o.cmd.mail.SendEmailRequestI.@2c3487c6] (erver-1144) notify finished: omero.cmd.SendEmailResponse@3f3e1c6b/omero.cmd.Status@6bbd53d

And nothing in OMEROweb.log

Finally, after checking my server log it was because the mail was refused by the IT service ....

Philippe

Re: Users connected

PostPosted: Tue Apr 21, 2015 6:59 am
by jmoore
Thanks for letting us know, Philippe.

Cheers,
~Josh.

Re: Users connected

PostPosted: Tue Apr 21, 2015 7:27 am
by phm
jmoore wrote:Thanks for letting us know, Philippe.

Cheers,
~Josh.


Hi Josh,

And what about a command to know the connected users. It's will be very useful for shutdown the server or for maintenance. Or how to know if some people transfer images ?

Cheers,

Philippe

Re: Users connected

PostPosted: Wed Apr 22, 2015 4:10 pm
by kennethgillen
Hi Philippe,

phm wrote:And what about a command to know the connected users. It's will be very useful for shutdown the server or for maintenance. Or how to know if some people transfer images ?


I will usually grep the Blitz log, for `user=` lines, though Josh has recommended using HQL to query the event log, as follows (replacing the date/time with whatever time you're interested in):

Code: Select all
/opt/omero/OMERO-CURRENT/bin/omero hql "select e.experimenter.omeName, count(e) from Event e where e.time > cast('2015-04-22 16:00', timestamp) group by e.experimenter.omeName" -q | egrep -v "root|sysadmin-userid|PUBLIC|guest"


Here's my Blitz log grep - but point to note, the above HQL seems to return the same users shown up in my Blitz log parse, and a few more. Since I'm not sure why that is, I usually run both.

Change the '[0-5]' to whatever minute range in the current hour you're interested in.
Code: Select all
cat /opt/omero/OMERO-CURRENT/var/log/Blitz-0.log | grep "$(date +%Y-%m-%d' '%H:)[0-5]"  | grep 'user=' | awk '{ print $8 }' | sort | cut -d',' -f1 | uniq | cut -d'=' -f2  | egrep -v '0' | xargs OMERO-CURRENT/bin/omero user info  --user-id


And I'll do a `tail` of the web server log, too, to see if there are existing sessions to OMERO.web.

Hope that's of some us.

All the best,

Kenny

Re: Users connected

PostPosted: Thu Apr 23, 2015 8:54 am
by phm
kennethgillen wrote:Hi Philippe,

phm wrote:And what about a command to know the connected users. It's will be very useful for shutdown the server or for maintenance. Or how to know if some people transfer images ?


I will usually grep the Blitz log, for `user=` lines, though Josh has recommended using HQL to query the event log, as follows (replacing the date/time with whatever time you're interested in):

Code: Select all
/opt/omero/OMERO-CURRENT/bin/omero hql "select e.experimenter.omeName, count(e) from Event e where e.time > cast('2015-04-22 16:00', timestamp) group by e.experimenter.omeName" -q | egrep -v "root|sysadmin-userid|PUBLIC|guest"


Here's my Blitz log grep - but point to note, the above HQL seems to return the same users shown up in my Blitz log parse, and a few more. Since I'm not sure why that is, I usually run both.

Change the '[0-5]' to whatever minute range in the current hour you're interested in.
Code: Select all
cat /opt/omero/OMERO-CURRENT/var/log/Blitz-0.log | grep "$(date +%Y-%m-%d' '%H:)[0-5]"  | grep 'user=' | awk '{ print $8 }' | sort | cut -d',' -f1 | uniq | cut -d'=' -f2  | egrep -v '0' | xargs OMERO-CURRENT/bin/omero user info  --user-id


And I'll do a `tail` of the web server log, too, to see if there are existing sessions to OMERO.web.

Hope that's of some us.

All the best,

Kenny


Thank Kenny you for "tips" is a bit difficult to remember..... An omero command like omero who_is_online could be very nice.


Philippe

Re: Users connected

PostPosted: Thu Apr 23, 2015 10:36 am
by jmoore
Agreed, Philippe. Already added a card to add the necessary methods. Thanks for the idea.

Cheers,
~Josh.

Re: Users connected

PostPosted: Thu Jun 11, 2015 3:22 pm
by kennethgillen
phm wrote:An omero command like omero who_is_online could be very nice.


Hi Philippe,

Just in case you're still watching this thread, I was just using the OMERO CLI command inspired by this thread, and thought I'd add it's help text here for reference.

This feature was implemented in the CLI and is now available with OMERO 5.1.2.

Code: Select all
[omerouser@server OMERO-CURRENT]$ bin/omero sessions who -h
usage: bin/omero sessions who [-h]

List all active server sessions

Administrators will receive a list of all active sessions
along with critical information on last activity. This is
useful for determining whether or not the server can be
restarted.

Other users will only see a list of names, i.e. users who
can be considered "online".

Optional Arguments:
  In addition to any higher level options

  -h, --help          show this help message and exit