HOWTO - Access Login Counter data with Jolokia

This article describes how to access information exposed through JMX by Open-Xchange with the Jolokia JMX-to-HTTP bridge, using "Login Counter" as an example.

Install Open-Xchange

See if you don't have Open-Xchange installed yet. Jolokia is part of the base product, no extra packages are needed.

Enable Jolokia

(See also

In etc/, 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: = /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 etc/, set: = 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 proxy_http.conf.

Reload your apache config and restart open-xchange for the changes to take effect.

Access the Jolokia interface

On localhost, call:

 $ curl http://yourname:yourpassword@localhost:8009/monitoring/jolokia/list > ox.json

If you enabled access from other hosts, you can also use a standard web browser. Open e.g.


You'll be asked for user name and password through a standard HTTP auth window.

Access specific information

The ox.json file you received in the last step gives you complete documentation what data is available through this interface.

As an example, the "Login Counter" interface (which is also used by the logincounter command line tool) is described like this:

"com.openexchange.reporting": {
	"name=Login Counter": {
		"desc": "Information on the management interface of the MBean",
		"op": {
			"getLastLoginTimeStamp": {
				"desc":"Operation exposed for management",
				"args": [
			"getNumberOfLogins": {
				"desc":"Operation exposed for management",
				"args": [

See for detailed documentation how to use the Jolokia interface, especially for the list of datatypes that can be passed as arguments and received in return values.

To know what the parameters p1, p2, etc. mean, you need to look at the source code. (See for information how to download it.)

In the example above, to get the number of logins in a specific timeframe and with a specific client, we need to call the method getNumberOfLogins with the parameters startDate, endDate, aggregate and clientstring. They correspond to the command line parameters to the logincounter command line tool as described on:

In curl this call would look like this:

 $ curl http://yourname:yourpassword@localhost:8009/monitoring/jolokia/exec/com.openexchange.reporting:name=Login%20Counter/getNumberOfLogins/2015-01-01T00:00:00/2015-01-31T23:59:59/true/open-xchange-appsuite/

If you have enabled access to the Jolokia interface from other hosts, the same information can be viewed in any web browser: