All Apps and Add-ons
Highlighted

Splunk support for Weblogic 9.x and 10.x (JMX metrics)

Engager

Does Splunk support Weblogic 9.x and 10.x specifically JMX metrics?

0 Karma
Highlighted

Re: Splunk support for Weblogic 9.x and 10.x (JMX metrics)

Contributor

Yes. You can index any kind of IT data in splunk, including simple metrics data like JMX. It's also easy to correlate metrics to text data (e.g. log messages) so you can figure out what else was happening on your server when you got a particular error message or saw a worrisome JMX value.

In order to get WebLogic JMX into Splunk, you'll want to write a scripted input (e.g. a java command-line app, Jython script, etc.) which collects the JMX metrics you want and then prints the data to stdout as name/value-pair text, which Splunk will then index.

You can take a look at how we did this in the Splunk for WebSphere Application Server app, where we wrote a Jython script which we executed inside WebSphere's command-line shell to call JMX to fetch metrics and print them to stdout. Splunk then indexes the data and automatically extracts fields. Look for WebSphereMBeanStats.py (inside the Splunk for WAS app) to see our Jython script.

0 Karma
Highlighted

Re: Splunk support for Weblogic 9.x and 10.x (JMX metrics)

Builder

Another path (which I took because it was easier for me) is to use the Weblogic Scripting Tool (WLST) as a scripted input to Splunk. I run a shell script which calls java weblogic.WLST and a script name..

I run the script every 5 minutes into an index, and can do reports on heap free, threads used, data source statistics. If anyone is interested in the view I can provide that as well..

Example Script:

import time

date = time.strftime("%d-%m-%Y %H:%M:%S")

### Connect to managed server
connect ('<adminaccount>','<password>','t3://<servername>:<serverport>')
serverRuntime();

### Get HEAP Stats
cd ('JVMRuntime/<managedservername>')
heapSizeMax = cmo.getHeapSizeMax()
heapFreeCurrent = cmo.getHeapFreeCurrent()
heapFreePercent = cmo.getHeapFreePercent()
TotalNumberOfThreads=cmo.getTotalNumberOfThreads()

### Print the results
print date,',Host=<managedservername>',',HeapSizeMax=',heapSizeMax,',HeapSizeCurrent=',heapFreeCurrent,',TotalNumberOfThreads=',TotalNumberOfThreads

### Get Database Settings.  Will need to customize with your DataSourceNames
cd('../../JDBCServiceRuntime/<managedservername>/JDBCDataSourceRuntimeMBeans/<datasourcename>');
ActiveConnectionsCurrentCount=cmo.getActiveConnectionsCurrentCount()
ActiveConnectionsHighCount=cmo.getActiveConnectionsHighCount()
ConnectionDelayTime=cmo.getConnectionDelayTime()
FailuresToReconnectCount=cmo.getFailuresToReconnectCount()
LeakedConnectionCount=cmo.getLeakedConnectionCount()
WaitingForConnectionCurrentCount=cmo.getWaitingForConnectionCurrentCount()
WaitingForConnectionHighCount=cmo.getWaitingForConnectionHighCount()

###Print the results
print date,',Host=<managedservername>',',datasource=<datasourcename>',',ActiveConnectionsCurrentCount=',ActiveConnectionsCurrentCount
,',ActiveConnectionsHighCount=',ActiveConnectionsHighCount,',ConnectionDelayTime=',ConnectionDelayTime,',FailuresToReconnec
tCount=',FailuresToReconnectCount,',LeakedConnectionCount=',LeakedConnectionCount,',WaitingForConnectionCurrentCount=',Wait
ingForConnectionCurrentCount,',WaitingForConnectionHighCount=',WaitingForConnectionHighCount

### Disconnect
disconnect()
Highlighted

Re: Splunk support for Weblogic 9.x and 10.x (JMX metrics)

Path Finder

I know that its been a while since you shared this. Do you have the full script that you are using to call this with? It looks like splunk knocked off the first letter of the lines. We're trying to do exactly what you posted here.

0 Karma
Highlighted

Re: Splunk support for Weblogic 9.x and 10.x (JMX metrics)

New Member

Hello Brian

I am interested in your view and details on how you implemented this using splunk. I was thinking on doing it using another tool (mrtg) but doing it using splunk makes perfect sense.

Cheers!

0 Karma
Highlighted

Re: Splunk support for Weblogic 9.x and 10.x (JMX metrics)

Ultra Champion

Have a look at SPLUNK for JMX

http://splunk-base.splunk.com/apps/25505/splunk-for-jmx

You may need to specify a custom weblogic jar -> wlfullclient.jar

and a jvm system property -> -Djmx.remote.protocol.provider.pkgs=weblogic.management.remote

to be able to connect and view the Weblogic MBeans (as detailed here for using JConsole to connect to Weblogic)

http://blogs.oracle.com/WebLogicServer/entry/managing_weblogic_servers_with

Details of adding that custom jar to SPLUNK for JMX are in the pdf documentation.You simply drop it in the "SPLUNK4JMX/bin/lib/ext" directory

You can add the jvm system property yourself in the poll_jmx.sh or poll_jmx.bat script.

Let me know how you get on !!

0 Karma
Highlighted

Re: Splunk support for Weblogic 9.x and 10.x (JMX metrics)

Splunk Employee
Splunk Employee

Has anyone tried this?

0 Karma
Highlighted

Re: Splunk support for Weblogic 9.x and 10.x (JMX metrics)

Ultra Champion

I haven't , but if it works with JConsole, as per the above blog link, then it should work with Splunk for JMX.

0 Karma