JMX/REST Management¶
In this chapter, the following topics are included:
Introduction to eXo Platform management Overall information about managing resources of eXo Platform, JMX and REST interfaces.
Management views of eXo Platform Introduction to the following set of management view types of eXo Platform and their Object Names:
Jobs and Job Scheduler List of the Cron Jobs and the Job Scheduler MBean.
eXo Platform notifications monitoring A step by step to monitor notifications.
Introduction to eXo Platform management¶
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.
How to manage eXo Platform with JMX¶
JMX and JMX Client
Note
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 <AdvancedCustomization> section.
Securing JMX connection
It is recommended to enable security for production system. You may:
Enable SSL. See Using SSL.
Enable Password Authentication. See Using Password Authentication and Using Password and Access Files.
How to manage eXo Platform with REST service¶
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.
Management views of eXo Platform¶
PortalContainer management view The management view of all objects and configurations of a given portal.
Cache management view The management view of eXo Platform caches at several levels that provides the critical performance information, especially useful for tuning the server.
Content management view The management view of WCMService.
JCR management view The management view of SessionRegistry, LockManager, Repository, and Workspace that allow you to monitor sessions, locks, repository configurations, and workspace configurations respectively.
Portal management view A set of the Portal management views, including Template statistics, Template service, Skin service, TokenStore, Portal statistics, and Application statistics.
Forum management view A set of the Forum management views, including Forum, Job, Plugin, Storage that allows you to control rules, statistics, information of data storage.
PortalContainer management view¶
PortalContainer manages all objects and configurations of a given portal.
The Object Name of PortalContainer MBeans: exo:container=portal,name=portal.
Attribute |
Description |
---|---|
|
Configuration information of the specified portal container in the XML format. |
|
The name of the portal container. |
|
The list of the registered component names. |
|
Indicates if the portal container is started or not. |
Operation |
Description |
---|---|
|
Returns configuration information of the portal container calculated by the loading mechanism. The returned value is an XML document in the eXo Kernel format. |
|
Returns the portal container name. |
|
Returns the list of all registered component names. |
|
Checks if the portal container is started or not. The portal container is only started once all its components have been started. |
Note
PortalContainer can be controlled through the following path: - http://mycompany.com:8080/rest/management/pcontainer.
Cache management view¶
eXo Platform uses caches at several levels. Monitoring them can provide the critical performance information, especially useful for tuning the server. Each cache is exposed with statistics and management operations.
CacheService¶
There are many Cache MBeans of which the Class Name is common: org.exoplatform.services.cache.concurrent.ConcurrentFIFOExoCache and the Object Names are: exo:service=cache,name={CacheName} where CacheName is specified for each MBean.
Attribute |
Description |
---|---|
|
The name of the cache. |
|
The maximum capacity (nodes) of the cache. |
|
The total number of times the cache was successfully queried. |
|
The total number of times the cache was queried without success. |
|
The number of entries in the cache. |
|
The valid period of the cache in seconds. If the value is set to -1, the cache never expires. |
Operation |
Description |
---|---|
|
Evicts all entries from the cache. This method can be used to force a programmatic flush of the cache. |
|
Returns the cache name. |
|
Returns the valid lifetime of an entry in the cache in seconds. |
|
Sets the valid lifetime of an entry in the cache in seconds. |
|
Returns the total number of successful hits. |
|
Returns the total number of unsuccessful hits. |
|
Returns the maximum capacity of the cache. |
|
Sets the maximum capacity of the cache. |
|
Returns the number of entries in the cache. |
CacheManager¶
The CacheManager MBean has no attribute and only one method to clear all the Caches.
The Object Name of CacheManager Mbeans: exo:service=cachemanager.
Operation |
Description |
---|---|
|
Forces a programmatic flush of all the registered caches. |
PicketLinkIDMCacheService¶
PicketLinkIDMCacheService is the default implementation for the organization model. It has no attribute.
The Object Name of PicketLinkIDMCacheService MBean: exo:portal=”portal”,service=PicketLinkIDMCacheService,name=plidmcache.
Operation |
Description |
---|---|
|
Invalidates all cache entries. |
|
Invalidates a specific cache namespace. |
|
Lists out all cache entries. |
Note
PicketLinkIDMCacheService can be controlled through the following path:
However, the REST View managements of CacheService and CacheManager are not currently exposed in this version.
Content management view¶
WCMService¶
The Object Name of WCMService MBean: exo:portal=portal,service=wcm,view=portal,type=content.
Attribute |
Description |
---|---|
|
The expiration period of portlet cache in seconds. |
Operation |
Description |
---|---|
|
Returns the expiration period of portlet cache in seconds. |
|
Sets the expiration period of portlet cache by entering the value into the expirationCache field. |
Note
WCMService can be controlled through the following paths respectively: - http://mycompany.com:8080/rest/management/wcmservice/.
JCR management view¶
Java Content Repository (JCR) provides a management view to monitor sessions, locks, repository configurations, and workspace configurations.
Repository¶
The Object Name of Repository MBean: exo:portal=portal,repository=repository.
Attribute |
Description |
---|---|
|
The name of the repository container. |
|
The list of registered component names in the repository. |
Operation |
Description |
---|---|
|
Returns the repository container name. |
|
Returns the list of registered component names in the repository. |
SessionRegistry¶
The Object Name of SessionRegistry MBean: exo:portal=portal,repository=repository,service=SessionRegistry.
Attribute |
Description |
---|---|
|
The expiration period of a JCR session. |
|
The number of currently active sessions. |
Operation |
Description |
---|---|
|
Cleans all JCR sessions timed out. |
|
Returns the session timeout. |
|
Sets the session timeout in seconds. |
|
Returns the number of currently active sessions. |
Workspace¶
There are several default workspaces listed below, each of them corresponds to a Workspace MBean:
Workspace Name |
Description |
---|---|
|
Data, such as sites content, documents, groups, records space, tags, and users. |
|
Data of DMS, including node types, templates, views, taxonomy trees. |
|
Data of Forum, FAQ and Poll applications. |
|
Data of the Portal model objects, such as navigations, pages, sites, and application registry. |
|
Information of Gadget token and Remember me token. |
|
Data of Social, including activity, identity, profile, relationship and space. |
|
Data of system, including versions storage, node types, namespaces. |
The Object Name of Workspace MBeans: exo:portal=portal,repository=repository,workspace={WorkspaceName} where WorkspaceName is the name of each workspace.
Attribute |
Description |
---|---|
|
The name of the workspace container. |
|
The list of registered component names in the workspace. |
Operation |
Description |
---|---|
|
Returns the workspace container name. |
|
Returns the list of registered component names in the workspace. |
LockManager¶
Each Workspace has an MBean to manage locks.
The Object Name of LockManager MBeans: exo:portal=portal,repository=repository,workspace={WorkspaceName},service=lockmanager where WorkspaceName is the name of each workspace.
Attribute |
Description |
---|---|
|
The number of active locks. |
Operation |
Description |
---|---|
|
Removes all expired JCR locks. |
|
Returns the number of active JCR locks. |
Note
- Currently, the REST View managements of SessionRegistry,
LockManager, Repository and Workspace are not exposed in this
version.
Portal management view¶
Template statistics¶
Template statistics exposes various templates used by the portal and its components to render markups. Various statistics are available for individual templates, and aggregated statistics, such as the list of the slowest templates. Most management operations are performed on a single template; those operations take the template identifier as an argument.
The Object Name of Template statistics MBean: exo:portal=portal,service=statistic,view=portal,type=template.
Attribute |
Description |
---|---|
|
The list of templates loaded. |
|
The list of the 10 slowest templates. |
|
The list of the 10 most used templates. |
|
The list of 10 fastest templates. |
Operation |
Description |
---|---|
|
Returns the average rendering time of a specified template in seconds. |
|
Returns the number of times executed by the specified template. |
``getMinTime(templateId)` ` |
Returns the minimum rendering time of the specified template in seconds. |
``getMaxTime(templateId)` ` |
Returns the maximum rendering time of the specified template in seconds. |
|
Returns the list of the 10 slowest templates. |
|
Returns the list of the 10 most used templates. |
|
Returns the list of templates loaded. |
|
Returns the list of the 10 fastest templates. |
Template management¶
Template management provides the capability to force the reload of a specified template.
The Object Name of Template management MBean: exo:portal=portal,service=management,view=portal,type=template.
Operation |
Description |
---|---|
|
Clears the template cache. |
``listCachedTemplates` ` |
Lists identifiers of the cached templates. |
|
Clears the template cache for a specified template identifier. |
Skin management¶
The Object Name of Skin management MBean: exo:portal=portal,service=management,view=portal,type=skin.
Attribute |
Description |
---|---|
|
The list of loaded skins by the skin service. |
Operation |
Description |
---|---|
|
Forces a reload of the specified skin and the operation. |
|
Forces a reload of the loaded skins. |
|
Returns the list of loaded skins by the skin service. |
TokenStore¶
The Object Name of TokenStore MBeans: exo:portal=portal,service=TokenStore,name={Name} where Name is the name of each specific token.
Attribute |
Description |
---|---|
|
The name of one specific token. |
|
The expiration period of one specific token in seconds. |
|
The expiration daemon period of one specific token in seconds. The token is deleted after the specified period. |
Operation |
Description |
---|---|
|
Removes all expired tokens. |
|
Returns the number of tokens, including valid tokens and expired tokens undeleted yet. |
|
Returns the token name. |
|
Returns the expiration time of one specific token in seconds. |
|
Returns the expiration daemon period of one specific token in seconds. |
eXo Platform provides the following TokenStore instances:
Token Name |
Description |
---|---|
|
Stores tokens of the Oauth gadget into the JCR node, such as org.exoplatform.portal.gadget.core.Gadget TokenInfoService. |
|
Stores common tokens into the JCR node, such as org.exoplatform.web.security.security.CookieTokenS ervice, and org.exoplatform.web.security.security.RemindPasswo rdTokenService. |
Portal statistics¶
The Object Name of Portal statistics MBean: exo:portal=portal,service=statistic,view=portal,type=portal.
Attribute |
Description |
---|---|
|
The list of identifiers of loaded portals. |
Operation |
Description |
---|---|
|
Returns the number of requests for the specified portal per second. |
|
Returns the average execution time of the specified portal in seconds. |
|
Returns the number of times the specified portal has been executed. |
|
Returns the minimum time of the specified portal in seconds. |
|
Returns the maximum time of the specified portal in seconds. |
|
Returns the list of identifiers of loaded portals. |
Application statistics¶
Various applications are exposed to provide relevant statistics.
The Object Name of Application statistics MBean: exo:portal=portal,service=statistic,view=portal,type=application.
Attribute |
Description |
---|---|
|
The list of loaded applications. |
|
The list of the 10 slowest applications. |
``MostExecutedApplications` ` |
The list of the 10 most executed applications. |
|
The list of the 10 fastest applications. |
Operation |
Description |
---|---|
|
Returns the average time spent of the specified application. |
|
Returns the number of times the specified application has been executed. |
``getMinTime(applicationId) `` |
Returns the minimum time spent of the specified application. |
``getMaxTime(applicationId) `` |
Returns the maximum time spent of the specified application. |
|
Returns the list of the 10 slowest applications. |
|
Returns the list of the 10 most executed applications. |
|
Returns the list of the 10 fastest applications. |
|
Returns the list of application identifiers classified in the alphabetic order. |
Note
Template statistics, Template management, Skin management, Portal statistics and Application statistics can be controlled through the following paths respectively:
However, the REST View management of TokenStore is currently not exposed in this version.
Forum management view¶
Some MBeans are provided to manage Forum application.
Forum¶
The Object Name of Forum MBean: exo:portal=portal,service=forum.
Attribute |
Description |
---|---|
|
The list of rules defining administrators. |
|
The string containing the specific ContactProvider implementation name which provides user profile to the forum. |
|
The string containing the configuration of the Mail service used for the notifications in Forum. |
|
The list of currently online users. |
Operation |
Description |
---|---|
|
Returns the number of currently online users. |
|
Checks if the user is the forum administrator or not. |
|
Returns the list of rules defining administrators. |
|
Returns the list of online users. |
|
Returns the name of a specific ContactProvider implementation. |
|
Sets ContactProvider implementation. |
``getMailServiceConfig `` |
Returns the Mail service configuration used to send notifications in Forum. |
Jobs¶
The Object Name of Forum Job MBeans: exo:portal=portal,service=forum,view=jobs,name={Name} where Name is specified for each job (listed later).
Attribute |
Description |
---|---|
|
The map containing the state information for Job instances. |
|
The FQDN of the job. |
|
The name of the Job. |
Operation |
Description |
---|---|
|
Returns the names of Job instances. |
``getJobClassName` ` |
Returns the FQDN of the job. |
|
Returns the state information of Job instances. |
The list of Forum Jobs:
Job |
Description |
---|---|
|
Deactivates topics which meet TWO predefined deactivation properties: inactiveDays and forumName in Forum. |
|
Updates the view count of topics and the list of viewers. |
|
Updates information of users logged in, serving for statistics. |
|
Indicates the number of active users in Forum. |
|
Sends email notifications in Forum. |
RoleRulesPlugin¶
The Object Name of RoleRulesPlugin MBean: exo:portal=portal,service=forum,view=plugins,name=”add.role.rules.plugin”.
Attribute |
Description |
---|---|
|
The list of all rules of RoleRulesPlugin. For example, the rule defining ‘root’ user as an administrator follows the form of ADMIN=root. |
|
The brief description of RoleRulesPlugin functions. |
|
The name of RoleRulesPlugin. |
|
The list of possible rule names; for example, the rule defining administrators is named ADMIN. |
Operation |
Description |
---|---|
|
Adds a rule. For example, to add the ADMIN rule for a user, you need to input two parameters: “ADMIN” in the p1 and user name in the p2. |
|
Returns the list of rules defining the user with the role inputted in p1. |
|
Returns the name of the plugin. |
|
Returns the list of possible rule names. For example, if ‘user1’ and ‘user2’ are defined as ADMIN (ADMIN=*user1, user2*), the list of returned rule names will be ADMIN. |
|
Returns the brief description of the plugin. |
|
Returns all rules added to the plugin. |
Storage¶
This MBean enables you to get storage information (data path, repository, workspace) of Forum application.
The Object Name of Forum Storage MBean: exo:portal=portal,service=forum,view=storage.
Attribute |
Description |
---|---|
|
The JCR data path of the Forum Storage. |
|
The name of repository containing the workspace where Forum data is stored. |
|
The name of workspace containing Forum data. |
Operation |
Description |
---|---|
|
Returns the name of repository of the Forum Storage. |
|
Returns the name of workspace of the Forum Storage. |
|
Returns the JCR data path of the Forum Storage. |
Note
Currently, the REST View managements of Forum, Job, Plugin, Storage are not exposed in this version.
Jobs and Job Scheduler¶
Jobs are components that run in background and perform scheduled tasks, such as sending notification emails every day.
In eXo Platform, jobs are managed by Quartz Scheduler. This framework allows to schedule jobs using simple patterns (daily, weekly) and Cron expressions.
The following tables are the jobs and their default configuration:
Name |
Description |
Schedule |
---|---|---|
changeStateJobToPubli shed (Content) |
Scans collaboration:/sites for awaiting content and publishes them. |
Every 2 minutes |
changeStateJobToUnpub lished (Content) |
Scans collaboration:/sites for awaiting content and unpublishes them. |
Every 2 minutes |
NotificationWeeklyJob |
Sends weekly notification. |
11 am, every Sunday |
NotificationDailyJob |
Sends daily notification. |
11 pm, every day |
WebNotificationJob |
Cleans the web notifications that are older than 30 days. |
On the 23rd of every month |
ReminderJob (Calendar) |
Searches for incoming events and sends email reminders. |
Every 15 seconds |
PopupReminderJob (Calendar) |
Searches for incoming events and shows popup reminders. |
Every 15 seconds |
periodically (Forum) |
Saves forum statistic data. |
Every 12 hours |
SendMailJob (Forum) |
Sends email notification in Forum. |
Every 2 minutes |
DelayWritesJob (Forum) |
Updates view count of topics. |
Every 1 minute |
DeactiveJob (Forum) |
Watches a forum and deactivates the topics that have no post for a period. Currently it is configured to a non-existing forum. |
Every 2 hours |
RecountActiveUserJob (Forum) |
Updates statistic of active users (who have posted in the last 15 days). |
Every 2 hours |
LoginJob (Forum) |
Updates information for users who are currently logged in. |
Every 2 minutes |
You can suspend or resume the jobs via JMX. Find the MBean
exo:portal=portal,service=JobSchedulerService
like in the
screenshot, it gives you the two operations.
eXo Platform notifications monitoring¶
Monitoring is a means to be aware about your system’s state. You can monitor different parts of eXo Platform through JConsole.
To monitor and observe notification settings in eXo Platform, you should follow these steps:
In the file exo.properties, add this property
exo.social.notification.statistics.active
and set it to true.Start your server and then open a new terminal to start JConsole using the command jconsole.
Go to MBeans tab.
Navigate in the tree to exo –> portal –> notification –> statistic to get statistics about eXo Platform notifications.