HzSessions HOWTO: Difference between revisions

From Open-Xchange
No edit summary
No edit summary
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.
This article describes how to access session information exposed through JMX by Open-Xchange with the Jolokia JMX-to-HTTP bridge.


== Enable 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.


(See also https://oxpedia.org/wiki/index.php?title=Jolokia)
* Prepare your system to be able to use Jolokia: [[Jolokia]]
* Another example using the concept: [[Jolokia_LoginCounter_HOWTO]]
* 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
* ... WIP ...


In <code>etc/jolokia.properties</code>, enable Jolokia by setting the following properties:
  com.openexchange.jolokia.start = true
  com.openexchange.jolokia.user = youruser
  com.openexchange.jolokia.password = yourpassword
Jolokia will not be enabled when no user/password is set.
You can optionally adjust this setting:
  com.openexchange.jolokia.servlet.name = /monitoring/jolokia
If you do, you need to adjust the examples below as well.
== Allow access from other hosts ==
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:
  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]]





Revision as of 19:08, 29 December 2015

HOWTO - Access session list in Hazelcast storage

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.

  • Prepare your system to be able to use Jolokia: Jolokia
  • Another example using the concept: Jolokia_LoginCounter_HOWTO
  • 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
  • ... WIP ...