Skip to content

ptmp13/weblogic-jmx-exporter

Repository files navigation

weblogic-jmx-exporter

Based on jmx_exporter

  1. Copy getPortFromAdminServer.py + getServerPortByName.py + setUserOverrides.sh to $DOMAIN_HOME/bin
  2. Copy jmxexporter.yml to $DOMAIN_HOME/config
  3. Copy jmx_prometheus_javaagent.jar to $DOMAIN_HOME/app
  4. Config prometheus + import dashboard to grafana. Prometheus service discovery file must be like prometheus_wls_sd.yml in repo. Becouse dashboard using vars from sd file (like weblogic_domainUID, weblogic_serverName)

As Result jmx port will be 1{$MANAGEDSERVER_PORT} for example if MANAGED SERVER runnning on port 8004 jmxport will be 18004

Settings

Open setUserOverrides.sh and set variables:

  1. wluser - username who have at least Monitor role!
  2. wlpass - password from wluser

You can dont set this vars, but in this case you cant get port for Dynamic Cluster servers. For 12c weblogic best way to get port from REST API (jq must install for parse output), but its way reqired wluser/wlpass.

Problems

If you have some problem with python script

Check it

export DOMAIN_HOME=<DOMAIN_HOME>
export SERVER_NAME=AdminServer
cd $DOMAIN_HOME/bin
python getServerPortByName.py
7001

If you have problem with RESTAPI

Check it

export ADMIN_URL="http://lost.com:7001"
export SERVER_NAME=AdminServer
export wluser=monitor
export wlpass=test
curl -u ${wluser}:${wlpass} -XGET ${ADMIN_URL}/management/weblogic/latest/serverConfig/servers/${SERVER_NAME}

In output you must see field listenPort

For wlst

Check it

export DOMAIN_HOME=<DOMAIN_HOME>
export T3ADMIN_URL="t3://lost.com:7001"
export SERVER_NAME=AdminServer
export wluser=monitor
export wlpass=test
$MW_HOME/oracle_common/common/bin/wlst.sh ${DOMAIN_HOME}/bin/getPortFromAdminServer.py

Old systems like RHEL/OEL/CentOS 6

For old systems like RHEL/OEL/CentOS 6 you must use OEL6 folder. becouse this systems have old python version.

Info about setUserOverrides.sh

This support 3 ways for get port for current managed server

  1. REST API - get using curl + jq
  2. WLST - jython script
  3. Parse config.xml - python

Priority 1-2-3 becouse only 1,2 support Dynamic Clusters, therefore 100% will return port but its required wluser/wlport + jq

Prometheus SD sample

You must add managed server like in file prometheus_wls_sd.yml

About

jmxexporter for weblogic. Get ports for Managed Server and set port for jmxexporter.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published