HzSessions HOWTO: Difference between revisions

From Open-Xchange
No edit summary
No edit summary
 
(4 intermediate revisions by one other user not shown)
Line 1: Line 1:
= HOWTO - Access session list in hazelcast Jolokia =  
= HOWTO - Access session list in Hazelcast storage =  


This article describes how to access information exposed through JMX by Open-Xchange with the Jolokia JMX-to-HTTP bridge, to get information about the current sessions.
'''Note: currenty this script is disfunctional as our current jolokia security setup disables the correponding request. Keeping that page for historical reasons.'''


== Enable Jolokia ==
This article describes how to access session information exposed through JMX by Open-Xchange with the Jolokia JMX-to-HTTP bridge.


(See also https://oxpedia.org/wiki/index.php?title=Jolokia)
Currently there is no dedicated tool shipped with Open-Xchange to get information about currently existing sessions on the system. This documentation and provided example script exposes access to this information if [[AppSuite:Running_a_cluster#Distributed_Session_Storage|open-xchange-sessionstorage-hazelcast]] is used to provide clusterwide session management.


In <code>etc/jolokia.properties</code>, enable Jolokia by setting the following properties:
'''Please note that the script referenced here is by no means production ready or supported! Use and modify it on your own risk!'''


  com.openexchange.jolokia.start = true
* Prepare your system to be able to use Jolokia: [[Jolokia]]
  com.openexchange.jolokia.user = youruser
* Get this archive [[File:Listsessions.zip]] and install it on any node
  com.openexchange.jolokia.password = yourpassword
* Replace username, password and baseurl in listsessions.pl to match your Jolokia configuration


Jolokia will not be enabled when no user/password is set.
Example output


You can optionally adjust this setting:
  [root@ox1 ox]# ./listsessions.pl
  contextId:47 userId:2 login:userA client:open-xchange-appsuite localIp:A.B.C.D
  contextId:10004 userId:2 login:userB client:OSX.OXDrive localIp:A.B.C.D


  com.openexchange.jolokia.servlet.name = /monitoring/jolokia


If you do, you need to adjust the examples below as well.
Limitations


== Allow access from other hosts ==
* DAV sessions are not saved into Hazelcast because they are transient and short living, therefore not appearing in the output
* USM sessions do not appear in the output


This is an optional step, if you want to access the Jolokia interface from other hosts than localhost. This may be very helpful during the development phase of a project. Please be aware that this interface exposes lots of "interesting" data, so if you remove the restriction to localhost, you need to ensure by other means (network setup, firewalls, web server configuration, ...) that no unauthorised access is possible on production systems.


In <code>etc/jolokia.properties</code>, set:
Generic HOWTO about the concept for using Jolokia to get JMX provided data: [[Jolokia_LoginCounter_HOWTO]]
 
  com.openexchange.jolokia.restrict.to.localhost = false
 
In your web server configuration, enable access to the jolokia servlet. For Apache this is possible by adding a ProxyPass directive for each OX host in the cluster:
 
  ProxyPass /monitoring/ox1/jolokia http://ox1-ip:8009/monitoring/jolokia
  ProxyPass /monitoring/ox2/jolokia http://ox2-ip:8009/monitoring/jolokia
  ...
On a default installation as described by our installation guides, this would be in <code>proxy_http.conf</code>.
 
Reload your apache config and restart open-xchange for the changes to take effect.
 
[[File:Listsessions.zip]]





Latest revision as of 07:02, 26 October 2017

HOWTO - Access session list in Hazelcast storage

Note: currenty this script is disfunctional as our current jolokia security setup disables the correponding request. Keeping that page for historical reasons.

This article describes how to access session information exposed through JMX by Open-Xchange with the Jolokia JMX-to-HTTP bridge.

Currently there is no dedicated tool shipped with Open-Xchange to get information about currently existing sessions on the system. This documentation and provided example script exposes access to this information if open-xchange-sessionstorage-hazelcast is used to provide clusterwide session management.

Please note that the script referenced here is by no means production ready or supported! Use and modify it on your own risk!

  • Prepare your system to be able to use Jolokia: Jolokia
  • Get this archive File:Listsessions.zip and install it on any node
  • Replace username, password and baseurl in listsessions.pl to match your Jolokia configuration

Example output

 [root@ox1 ox]# ./listsessions.pl 
 contextId:47 userId:2 login:userA client:open-xchange-appsuite localIp:A.B.C.D
 contextId:10004 userId:2 login:userB client:OSX.OXDrive localIp:A.B.C.D


Limitations

  • DAV sessions are not saved into Hazelcast because they are transient and short living, therefore not appearing in the output
  • USM sessions do not appear in the output


Generic HOWTO about the concept for using Jolokia to get JMX provided data: Jolokia_LoginCounter_HOWTO