DOYENSYS Knowledge Portal




We Welcome you to visit our DOYENSYS KNOWLEDGE PORTAL : Doyensys Knowledge Portal




Monday, January 9, 2017

Script to monitor Weblogic managed server status

#!/bin/sh
# Script to monitor Weblogic managed server status
# Author : Ramasubbu Sunadaravel
# Date   : 23-Aug-2016

. /r11/app/FLRPRD/R12apps/EBSapps.env

## VARIABLES ###
LOGFILE=/export/home/applmgr/oraprocs/logs
MAIL_LIST=rsundaravel@yahoo.com
ADMIN_URL=http://test.domain.int:7014/console
PARFILE=/export/home/applmgr/oraprocs/mgd_server_list.par ## - place all the managed servers name.
WEBLOGIC_PWD = /export/home/applmgr/oraprocs/.weblogicpwd

## SCRIPT STARTS
cat $PARFILE |while read line
do
managed_server=`echo $line | awk '{print $1}'`
LOGFILE=/export/home/applmgr/oraprocs/logs
echo $managed_server
echo `cat $WEBLOGIC_PWD`|$ADMIN_SCRIPTS_HOME/admanagedsrvctl.sh status $managed_server|grep $managed_server|grep -v logs > $LOGFILE/$managed_server.log
status=`cat $LOGFILE/$managed_server.log|grep "is running"|wc -l`
if test $status -eq 1
then
echo "$managed_server is Running"
else
echo "$managed_server is Not Running. Please refer Documents to restart "|mailx -s "BLACKBERRY:- Managed Server $managed_server is not running on $ADMIN_URL" $MAIL_LIST
fi
done
## END

PARFILE Entries:
cat /export/home/applmgr/oraprocs/mgd_server_list.par
oacore_server1
oacore_server2
forms_server1
oafm_server1

No comments: