Advanced WebLogic Monitoring: JMX MBean Tutorial

WLSDM for WebLogic
Feb 15 · 5 min read

Develop JMX MBeans and Automate with WLSDM Metric Actions

This tutorial is prepared for Advanced WebLogic Administration and Automation. Setting up internal JMX MBean objects are the “best and ultimate practice” for application monitoring infrastructure.


  1. How to develop and register JMX MBean to Oracle WebLogic Server?
  2. How to check SERVER disk space by using JMX MBean on WebLogic?
  3. How to define WLSDM User-Defined Metric Actions?
  4. How to delete or move Application logs automatically when given threshold exceeds for disc usage on SERVER?

Problem: The application which is deployed to Oracle WebLogic Server 12c ( is increasing server disk space continuously and in peak times it makes the server disk usage 100%. Meanwhile, the service goes down and causes the service down-time.


  1. Develop JMX MBeans which check server disk usage (JMX StandardMBean)
  2. Create alarm and notify when the disk usage exceeds 95% (JMX MBean Monitoring - UsedDiskSpace)
  3. Create “User-Defined Metric Action” on WLSDM which is targeted to “delete or move application logs”
  4. When UsedDiskSpacepercentage higher than the given threshold, “ClearLogs” metric action would be triggered by WLSDM and all application logs would be deleted automatically. That means “NO Down-time” with advanced WebLogic monitoring and automation.

Video Tutorial :

Tutorial is prepared for this problem and for any other similar problems.

The tutorial is short and targeted to overcome SERVER disk problem.

Watch Tutorial:

How to develop your own JMX MBean and JMX Metric Action? (SUMMARY)

Above video tutorial and sample project quite enough to setup an advanced WebLogic monitoring and automation infrastructure. Senior WebLogic Administrators, DevOps or Developers had better consider every problematic issue while managing mission-critical WebLogic domains.

  1. Login to WebLogic Console
  2. Go to WLSDM Console Metric Browser Page

WebLogic Monitoring Dashboard: WLSDM Console

  1. WLSDM Metric Browser displays all WebLogic JMX MBeans dynamically.
  2. Go to “WLSDM Console > Configuration > Metric Browser”
Metric Settings & JMX MBean Browser

2. Check new deployed JMX Custom MBeans on WLSDM Metric Browser page for DiskSpaceWatcher MBeans. Anymore FreeDiskSpace and UsedDiskSpace JMX MBeans are visible on WLSDM v3.9.1 Metric Browser.

Custom WebLogic JMX MBeans

3. Create new Dashboard and name it DiskSpaceWatch.

4. Add FreeDiskSpace and UsedDiskSpace JMX Metrics to DiskSpaceWatch Dashboard and save all.

Adding Custom JMX Metrics to WLSDM Dashboard

5. Anymore Custom JMX MBeans that we developed and its values can be visualized on WLSDM Console Smart Dashboards. You would see two charts on DiskSpaceWatch dashboard as below.

WLSDM JMX Metric Dashboard: Grid View

Dynamic JMX MBean Charts-1: Free Disk Space

Dynamic JMX MBean Charts-2: Used Disk Space

6. Set threshold values for FreeDiskSpace and UsedDiskSpace MBeans and see what will happen? Test it by setting low thresholds. For instance, set the threshold value for UsedDiskSpace to “60” and get below notifications.JMX MBean monitoring alarms would be generated by WLSDM as page and email Notification.

WLSDM: JMX Metric Page Notification

WLSDM: JMX Metric Email Alarm

7. Now Define Custom Metric Actions for FreeDiskSpace:
Custom metric actions can be defined on WLSDM. Now going to create a custom action for FreeDiskSpace metric.

8. Go to “Configuration > User-Defined Metric Actions” Page.

WLSDM Actions: User-Defined Metric Actions

9. Create new “User-Defined Metric Action” as below.

WLSDM: User-Defined JMX Metric Actions

10. Note: “Executable Target Files” can be .SH or .BAT file. System Parameters such as $METRIC_NAME, $METRIC_VALUE can be passed to “Executable Target File” as an argument by WLSDM.

11. Content of “clearlogs.bat” file:

cd C:\wlsdm\logs
del /F
/Q *.*

12. Anymore “ClearLogs” Cusom Action can be listed on Actions Window. Select “ClearLogs”.

WLSDM Metric Actions: Select ClearLogs

13. Reset UsedDiskSpace or FreeDiskSpace Metric threshold value and get METRIC CLEAR alarm from WLSDM. (For testing ClearLogs action)

14. Reassign threshold value for FreeDiskSpace metric and get METRIC WARNING alarm from WLSDM. (ie. set lower than 30)

15. Oops! FreeDiskSpace alarm generated! And ClearLogs action has been executed automatically. All logs under C:\wlsdm\logs has been deleted.

WLSDM JMX HTML Email Alert: User-Defined Metric Action

Monitoring is meaningful and powerful with automation

WLSDM for WebLogic

WLSDM is a WebLogic console extension which enables…

WLSDM for WebLogic

Native Oracle WebLogic Monitoring WLSDM is developed by the best WebLogic developers for the best WebLogic administrators to support mission critical HA domains. Supports all plain WebLogic and Fusion Middleware (FMW) WebLogic domains. Download now!

WLSDM for WebLogic

Written by

WLSDM for WebLogic

Native Oracle WebLogic Monitoring WLSDM is developed by the best WebLogic developers for the best WebLogic administrators to support mission critical HA domains. Supports all plain WebLogic and Fusion Middleware (FMW) WebLogic domains. Download now!

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store