Managing resources of eXo Platform is critical for IT operators and system administrators to monitor and supervise the production system. eXo Platform can be managed using JMX (Java Management Extension) tools or REST service.
To use JMX, some settings are required. To use REST service, you just need a browser. As you will see later in this chapter, all operations are available in JMX and some of them are available in REST. So use JMX if you need all operations and use REST in some cases, for example, you are on a machine that JMX is not installed, or at remote region where JMX is inaccessible because of security setup.
JMX and JMX Client
See Oracle's Documentation to learn about JMX (Java Management Extension).
To manage eXo Platform with JMX, you need a JMX Client, or more exactly an MBean Browser. JConsole is a built-in tool, and it features an MBean browser, so it does not require any installation. Another suggestion is VisualVM, which requires some steps to install its MBean plugin.
The tools are graphical and you may just try and use to explore MBean. In this chapter, the following terms will be used to describe an individual or a group of similar MBeans:
Object Name is used to identify and indicate an MBean. All MBeans introduced in this chapter can be found under a group "exo", however their organization may make it difficult to find an MBean. For example, you will see three groups with the same name "portal", so this document will not indicate an MBean by its position in the MBeans tree, but by its Object Name.
If you are using VisualVM, you can see Object Name in the "Metadata" tab.
Attribute is a pair of "Name" and "Value". A list of Attributes shows the state of an MBean object.
Operation is a function that you can invoke. Each MBean provides some (or no) Operations. Some Operations are "Set" and some Operations are "Get". An Operation may require data inputs.
Configuring eXo Platform to allow JMX access
The JMX configurations are JVM options and thus basically not specific to eXo Platform. Such configurations are explained at Oracle's Documentation.
In eXo Platform, by default JMX is not configured. Thus, local access is enabled and remote access is disabled. Authentication is disabled as well, this means username and password are not required. If you want to enable remote access or authorization, you need to start customizing eXo Platform, as instructed in the Customizing environment variables section.
After the start, put your JMX configurations in the form described in Advanced Customization section.
Although the two sections are written for Tomcat bundle, it is very similar for JBoss, except the customized configuration file.
In JBoss, the file is
$PLATFORM_JBOSS_HOME/bin/standalone-customize.conf for Linux,
$PLATFORM_JBOSS_HOME/bin/standalone-customize.conf.bat for Windows.
You can create it by using the sample file
$PLATFORM_JBOSS_HOME/bin/standalone-customize.sample.conf for Linux
$PLATFORM_JBOSS_HOME/bin/standalone-customize.sample.conf.bat for Windows.
Securing JMX connection
It is recommended to enable security for production system. You may:
Using REST service, you can do some operations with a browser. It requires no setup.
You need to be member of /platform/administrators to access REST services.
You also need to know the URL of a service (or its attributes and operations) to access it. You can get the URLs as follows:
Enter the base URL: http://[your_server]:[your_port]/rest/private/management, which is to access all management REST services, in your browser, then log in. The page returns a list of available REST services in plain text.
Select a service name and append it to the base URL. You will have the service's URL, for example: http://[your_server]:[your_port]/rest/private/management/skinservice. Entering this URL, you will get a list of attributes (as "properties") and operations (as "method").
Continue appending an attribute of Step 2 to have URL of a method or property. Let's see the "skinservice" as an example:
Its property "SkinList" can be accessed by the URL: http://[your_server]:[your_port]/rest/private/management/skinservice/SkinList.
Its method "reloadSkins" can be invoked by the URL: http://[your_server]:[your_port]/rest/private/management/skinservice/reloadSkins.
The URL of the method "reloadSkin" is a bit complex because the method requires parameter "skinId" (to know which Skin will be reloaded): http://[your_server]:[your_port]/rest/private/management/skinservice/reloadSkin?skinId=Default.