Monday, May 23, 2016

Stuck Thread Alert in UNIX - Weblogic

Following is the script which can be used to get email alerts in case of stuck threads in weblogic (installed on UNIX machines)

ScriptName: stuckCheckMS1.sh
#!/bin/ksh
 

Somefile=/export/home/oracle/stuckLogs/ms1_stuckCheck.log
 

count="$(/usr/ucb/ps auxwww | grep ms1 | grep Dweblogic | cut -c 10-15 | tr -d ' ' | xargs /opt/oracle/products/wls10.3.6/jdk1.6.0_45/bin/sparcv9/jstack -F | tee /export/home/oracle/stuckLogs/ms1_stuck.log_`/usr/bin/date +\%m-\%d-\%y-\%H-\%M` | grep STUCK | wc -l)"

if [ $count != 0 ]
then
                        echo "\n Server MS1 has stuck threads on" `/usr/bin/date +\%m-\%d-\%y-\%H-\%M` | mail -s 'STUCK thread on MS1' Some1@gmail.com
> $Sfile
else
                        echo "\n stuck threads status=okay" > $Somefile
fi
 

exit

Admin Password Change - Weblogic

1) Stop the weblogic Managed servers

2) Export the realm

  • Login to Admin Console --> Security Realms —> myrealm(Your realm Name)—> Migration(Tab)—> Export (Tab)

3) Stop the Admin Server

4) Rename the data folder   

  • mv {DOMAIN-HOME}/servers/AdminServer/data {DOMAIN-HOME}/servers/AdminServer/data-old

5) Take Back-up of DefaultAuthenticatorInit.ldift   

  • cd {DOMAIN-HOME}\security
  • mv DefaultAuthenticatorInit.ldift DefaultAuthenticatorInit_old.ldift

6)    Set the environment variables (don’t forget "." at the beginning)

  • cd {DOMAIN-HOME}/bin
  • . /setDomainEnv.sh

7) Reset the password (don’t forget "." at the end) to generate a new DefaultAuthenticatorInit.ldift   

  • cd {DOMAIN-HOME}/security
  • java weblogic.security.utils.AdminAccount .

8) Update the boot.properties file   

  • {DOMAIN-HOME}/servers/AdminServer/security/boot.properties
        username={new-username}
        password={new-password}

9) Start the Admin Server --> startWeblogic.sh

10)    Import realm   

  • Login to Admin Console
  • Security Realms —> myrealm(Your realm Name) —> Migration(Tab) —> Import (Tab)

11)    Restart Admin Again   

  • stopWeblogic.sh
  • startWeblogic.sh

12)    Start the Managed Servers    

  • Login to Admin console with new password and Start the managed servers

Password Complexity or Password Validation - Weblogic

Step-by-Step approach to implement password complexity/password validation method for weblogic domain:

1) Login to admin console
2) Stop all the managed servers
3) Click Lock & Edit
4) Go to Security Realms and select the name of the realm you are configuring
5) Select Providers > Password Validation
6) The Password Validation Providers table lists the Password Validation providers configured in this security realm
7) Click option “New"
8) Enter any desired name (which will be suitable for your domain/requirement)
9) From the Type drop-down list, select the type of the Password Validation provider and click OK
10) Now the next step is to configure the parameters. As an example, If I select below:
1 number
1 special Character
1 lowercase
1 uppercase
 And total of 8 character password

11) Save and activate changes, followed by admin server restart
12) Create a new user to see whether it meets the requirement or change password for existing user
13) Now Start managed Servers