The JMX agent of WSO2 DAS monitors JMX attributes of a required JMX-enabled server (e.g. Carbon-based servers), and stores monitored data in WSO2 DAS. It uses the Thrift API of WSO2 DAS to send monitored data to DAS server. You can create a JMX monitoring profile to monitor a set of attributes from a single JMX server.
Adding the default JMX profile
You can set up the default JMX toolbox which is shipped with WSO2 DAS to monitor system resources of a WSO2 server (CPU/memory/OS) running on Linux. Follow the steps below to setup this default JMX toolbox.
- Log in to the management console using admin/admin credentials and the following URL: https://<DAS_HOST>:<DAS_PORT>/carbon/
- Click Configure, and then click JMX Agent.
- Click Add Default JMX Toolbox to monitor system resources of a WSo2 server running on Linux (CPU/Memory/OS). This adds a pre-configured server profile to monitor the JMX attributes of WSO2 DAS itself as shown below.
- Click Enable in the Actions column, to enable the added server profile, and then click Edit.
Change the pre-configured details of the server profile as required.
You can change the Server URL, to monitor any WSO2 server accordingly. Change all occurrences of the host and port (if you have set a port offset on the server) accordingly in the JMX server URL.
Click Add More to monitor more attributes by the server profile if required in the below screen.
- Click an MBean on the list that loads to view its attributes list.
- Select the attributes that you require to monitor by this profile as shown below. You can set an alias to easily identify the data in the Data Access Layer of WSO2 DAS.
- Click Save to save the changes.
- Click No in the below pop-up message, to add the changes to the existing version of the server profile.
Else, click Yes in the above pop-up message, to save the changes by incrementing the version of the server profile as shown below.
Adding a JMX server profile
Follow the steps below to set up a JMX server profile in WSO2 DAS to monitor JMX attributes.
- Log in to the management console using admin/admin credentials and the following URL: https://<DAS_HOST>:<DAS_PORT>/carbon/
- Click Configure, and then click JMX Agent.
- Click Add JMX Server Profile, to add a new monitoring profile.
Enter the required details as shown below.
The details you enter in the above screen are described below.Field Description Example Name Unique name of the server profile. testProfile
Schedule CROn expression defining how often the attributes should be monitored. once every 2 seconds (0/2**?**)
Server URL The JMX server URL. service:jmx:rmi://localhost:11111/jndi/rmi://localhost:9999/jmxrmi
(Use this example to monitor DAS by itself).Change all occurrences of the host and port (if you have set a port offset on the server) accordingly in the JMX server URL.
User Name The username of the JMX server. admin
Password The password of the JMX server. admin
- Click Load MBeans. You see the loaded MBeans of the JMX server as shown below.
- Click an MBean on the list that loads to view its attributes list.
- Select the attributes that you require to monitor by this profile as shown below. You can set an alias to easily identify the data in the Data Access Layer of WSO2 DAS.
Click Save. You view the new server profile added to the list of existing profiles as shown below.
You can enable/disable monitoring of JMX attributes, and also edit or delete the monitoring profiles using the options provided in this screen.
After you edit the server profile, click No in the below pop-up message, to add the changes to the existing version of the server profile, or click Yes to save the changes by incrementing the version of the server profile as shown below.
Uploading the C-App
WSO2 DAS is shipped with a sample C-App for the JMX Agent. This includes all the artifacts which you need to publish data to the JMX agent which you enabled above, and to persist that data. Follow the steps below to upload this sample Carbon Application (c-App) file to the DAS. For more information, see Carbon Application Deployment for DAS.
- Log in to the DAS management console using the following URL: https://<DAS_HOST>:<DAS_PORT>/carbon/
- Click Main, and then click Add in the Carbon Applications menu.
- Click Choose File, and upload the
<DAS_HOME>/samples/capps/JMX_Agent.car
file as shown below. - Click Main, then click Carbon Applications, and then click List view, to see the uploaded Carbon application as shown below.
Viewing the output
You may use the Data Explorer of the WSO2 DAS Management Console to browse published events.
Using the Data Explorer
Follow the steps below to use the Data Explorer to view the output.
- Log in to the DAS management console if you are not already logged in.
- Click Main, and then click Data Explorer in the Interactive Analytics menu.
- Select
JMX_AGENT_TOOLBLX
for the Table Name as shown below. - Click Search. You view the published data as shown below.