WebLogic 12.2.1 provides a new RESTful management interface with full accesses to all WebLogic Server resources. This interface offers an alternative to the WLST scripting or JMX developments for the management and the monitoring of WebLogic Domains.

The following of this blog provides a few examples demonstrating the simplicity and the efficiency of the REST requests.

WebLogic Server State
When checking a WebLogic Server state, we are interested in the state and in the “ActivationTime” that shows the last time the server was started. Low value can indicate the server was restarted recently and may be automatically by the node manager after a crash.
The following RESTful URL requests the state of a WebLogic Server named “server1”

https://host01:7002/management/weblogic/latest/domainRuntime/serverRuntimes/server1?fields=state,activationTime&links=none

Output:

{
"state": "RUNNING",
"activationTime": 1470982524188
}

The following RESTful URL requests the state of all WebLogic Servers in a domain:

https://host01:7002/management/weblogic/latest/domainRuntime/serverRuntimes?fields=name,state,activationTime&links=none

Output:

{
"name": "AdminServer",
"state": "RUNNING",
"activationTime": 1473234973467
},
{
"name": "server2",
"state": "RUNNING",
"activationTime": 1473235510682
},
{
"name": "server1",
"state": "RUNNING",
"activationTime": 1473235506258
}

Get JVM Key Metrics
Monitoring the memory usage provides a good view on how the application behaves regarding memory consumption. Even if the memory management is a JVM task, the WebLogic Server mbeans can be queried for some heap usage information.
The following RESTful URL requests the JVM key metrics of a WebLogic Server named “server1”

https://host01:7002/management/weblogic/latest/domainRuntime/serverRuntimes/server1/JVMRuntime?links=none&fields=heapSizeCurrent,heapFreeCurrent,heapFreePercent,heapSizeMax

Output:

{
"heapSizeCurrent": 259588096,
"heapFreeCurrent": 101962840,
"heapSizeMax": 518979584,
"heapFreePercent": 72
}

Get WebLogic Threads key metrics
When WebLogic opens up too many threads to service the load, there is a decrease in performance, due to the resources (CPU, Memory) usage.

https://host01:7002/management/weblogic/latest/domainRuntime/serverRuntimes/server1/threadPoolRuntime?links=none&fields=executeThreadIdleCount,hoggingThreadCount,pendingUserRequestCount,completedRequestCount,throughput,healthState

Output:

{
"executeThreadIdleCount": 0,
"completedRequestCount": 4652,
"pendingUserRequestCount": 0,
"throughput": 1.999000499750125,
"hoggingThreadCount": 0,
"healthState": {
"state": "ok",
"subsystemName": null,
"partitionName": null,
"symptoms": []
}
}

Get JDBC Runtime Metrics
“Active Connection Current Count”, “Current Connection High Count”, “Waiting for Connection High count” allows you to validate that you have the correct amount of resources available to service the client’s needs. It’s also helpful to determine if you need to increase or decrease the pool size. While “Wait Seconds High Count”, “Waiting for Connection Failure Total” and “Connection Delay Times” can be used to determine DB responsiveness and how the clients are impacted by the connection pool size.

https://host01:7002/management/weblogic/12.2.1.0/domainRuntime/serverRuntimes/server1/JDBCServiceRuntime/JDBCDataSourceRuntimeMBeans/myDS?links=none&fields=name,activeConnectionsCurrentCount,activeConnectionsHighCount,waitingForConnectionHighCount,waitSecondsHighCount,waitingForConnectionFailure

Output:

{
"name": “myDS",
"state": "Running",
"activeConnectionsCurrentCount": 4,
"activeConnectionsHighCount": 8,
"waitingForConnectionFailureTotal": 0,
"waitingForConnectionHighCount": 0,
"waitSecondsHighCount": 0,
}

Get Application Runtime Metrics
We can fetch some useful information like “how many sessions were connected to the application” and how many concurrent sessions”

https://host01:7002/management/weblogic/latest/domainRuntime/serverRuntimes/server1/applicationRuntimes/SimpleAuctionWebAppDb/componentRuntimes?fields=openSessionsCurrentCount,sessionsOpenedTotalCount,openSessionsHighCount&links=none

Output:

{
"openSessionsCurrentCount": 12,
"sessionsOpenedTotalCount": 255,
"openSessionsHighCount": 15
}

The WebLogic REST management allows to access directly the WebLogic MBeans without any additional resource cost. The Monitoring tools can only benefit from this WebLogic RESTful interface.  As WebLogic RESTful requests used for Monitoring are simple, the java plugin for the dbi monitoring has been developed in two days.