How to Monitor OID Status and Restart the LDAP Service When OID is Down?

WLSDM for WebLogic
May 12 · 3 min read

We prepared WLSDM OID DevOps MBean blog about when OID shuts down due to external problems such as a network issue, the system will be provided to stand up. First of all, We are going to create WLSDM DevOps MBean then assign restart script on it. If the dummy LDAP search on DevOps MBean does not return any result, the opmnctl service will be restart by triggering the action script.

1. Creating Generic DevOps Mbean

1.1 Login to WebLogic console and go to WLSDM Console.

1.2 Go to “Configuration > Monitoring & Diagnostics”.

1.3 Click the “New User DevOps MBean” button in WLSDM “page operation” menu.

1.4 Choose “Embedded Script” from the dropdown list then select target server.

1.5 Edit the script and paste. Click “Transform:Run & Get Mbean Attributes” button. Wizard is going to generate JMX Mbean Attributes then click “Next” button.

ORACLE_HOME=/data/weblogic/products/fmw10360/Oracle_IDM1  
export ORACLE_HOME
JAVA_HOME=/data/weblogic/products/jdk/latest
export JAVA_HOME
ldapPath=$ORACLE_HOME/bin/ldapsearchHOST1=oid01.hostname.com
HOST2=oid02.hostname.com
PORT=3060
USER="username"
PASS="password"
CN="cn=,***dc=com"
Search_CN="cn=jhon.doe"
PATH=$JAVA_HOME/bin:$ORACLE_HOME:/bin:$PATH:$HOME/bin
export PATH
echo OID_CHECK01=$( if [[ $($ldapPath -h $HOST1 -p $PORT -D cn=$USER -w $PASS -b $CN $Search_CN .) == *jhon* ]] ;
then echo 1; else echo 0 ; fi) echo OID_CHECK02=$( if [[ $($ldapPath -h $HOST2 -p $PORT -D cn=$USER -w $PASS -b $CN $Search_CN .) == *jhon* ]] ;
then echo 1; else echo 0 ; fi)

1.6 Create a new dashboard or add MBean Chart to an existing Dashboard.

2. Add the “New User Defined Action / Script” button in the page operations.

2.1 Type an Action Name, select embedded script and write the executable script. then click the save button.

opmnctl stopall &  
wait $!
if [[ $(ps -ef | grep ldap | wc -l) > 1 ]];then
pkill -f -9 ldap
sleep 2
fi
opmnctl startall

3. Navigate to “Monitoring > Custom Dashboard” Click the “Metric & Chart Options” to adjust alarm and other operations.

3.1 Click “Actions” button on chart options modal window and select “RestartOID” action then click save button.

3.2 Set the alarm “ON”, operator as “<” and set alarm treshold value as 1.

4. When the alarm is triggered, the action script will restarts the opmnctl service.

Getting Started… https://wlsdm.com/download

Download WLSDM Now !

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! https://wlsdm.com/download

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! https://wlsdm.com/download