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

Ahmet Kaygısız
Mar 4 · 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.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/ldapsearch

HOST1=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.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.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.

WLSDM for WebLogic

WLSDM is a WebLogic console extension which enables performance monitoring for all WebLogic resources. Download now! https://wlsdm.com/download

Ahmet Kaygısız

Written by

Jr. Java Developer

WLSDM for WebLogic

WLSDM is a WebLogic console extension which enables performance monitoring for all WebLogic resources. Download now! https://wlsdm.com/download