Based on jmx_exporter
- Copy getPortFromAdminServer.py + getServerPortByName.py + setUserOverrides.sh to $DOMAIN_HOME/bin
- Copy jmxexporter.yml to $DOMAIN_HOME/config
- Copy jmx_prometheus_javaagent.jar to $DOMAIN_HOME/app
- 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
Open setUserOverrides.sh and set variables:
- wluser - username who have at least Monitor role!
- 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.
Check it
export DOMAIN_HOME=<DOMAIN_HOME>
export SERVER_NAME=AdminServer
cd $DOMAIN_HOME/bin
python getServerPortByName.py
7001
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
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
For old systems like RHEL/OEL/CentOS 6 you must use OEL6 folder. becouse this systems have old python version.
This support 3 ways for get port for current managed server
- REST API - get using curl + jq
- WLST - jython script
- 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
You must add managed server like in file prometheus_wls_sd.yml