Architecture/WAS
JEUS 7 이상(Incl. webtob) 점검 SCRIPT
GOMSHIKI
2023. 11. 16. 09:41
반응형
#!/bin/ksh
OWN_ID="유저명"
PRO_NAME="jeus"
if [ `whoami` != ${OWN_ID} ]
then
echo "Change User to ${OWN_ID}"
exit
fi
set -A WAS_LIST1 \
jeus.server.JeusBootStrapper \
DadminServer \
Dnodemanager \
D컨테이너명
set -A WAS_LIST2 \
Admin \
NodeManager \
"컨테이너명 WAS"
#### WAS Status check ####
echo
echo " ----------- WAS Process Check Start -------------- "
i=0
for n in ${WAS_LIST1[@]}
do
PS_CNT=`ps -ef | awk '{ if( $1 == "'"${OWN_ID}"'" ) print }' | grep ${PRO_NAME} | grep "${n}" | grep -v grep | wc -l | tr -d " "`
if [ ${PS_CNT} -eq 운영중인 WAS 개수 ]
then
printf "%-22s%3s%s\n" "${WAS_LIST2[$i]} " " : " "[ OK ]"
else
echo "\033[5m\c"
printf "%-22s%s%s\n" "${WAS_LIST2[$i]} " " : " "[ NOT OK ]"
echo "\033[0m\c"
fi
i=$((${i}+1))
done
echo "---------------- WAS Process Check End ----------------- "
echo
echo "---------------- Container Check Start ----------------- "
AAA(){
echo "si"
echo "exit"
}
OK_CNT=` AAA | /APP/jeus7/bin/dsa | grep RUNNING | wc -l | tr -d " "`
if [ ${OK_CNT} -eq 운영중인 컨테이너 개수 ]
then
printf "%-22s%3s%s\n" "Container Status" " : " "[ OK ]"
else
echo "\033[5m\c"
printf "%-22s%3%s\n" "Container Status" " : " "[ NOT OK ]"
echo "\033[0m\c"
echo "type for check : echo si | /APP/jeus7/bin/dsa"
fi
echo "---------------- Container Check End ----------------- "
echo
echo "---------------- Application Check Start ----------------- "
AAA(){
echo "appinfo"
echo "exit"
}
OK_CNT=` AAA | /APP/jeus7/bin/dsa | grep RUNNING | wc -l | tr -d " "`
if [ ${OK_CNT} -eq 실행중인 어플리케이션 개수 ]
then
printf "%-22s%3s%s\n" "Application Status" " : " "[ OK ]"
else
echo "\033[5m\c"
printf "%-22s%3s%s\n" "Application Status" " : " "[ NOT OK ]"
echo "\033[0m\c"
echo "type for check : echo appinfo | /APP/jeus7/bin/dsa"
fi
echo "---------------- Application Check End ----------------- "
echo
echo "---------------- Web Server Container Check Start ----------------- "
AAA(){
echo "st -server 컨테이너명 -t"
echo "exit"
}
OK_CNT=`AAA | /APP/jeus7/bin/dsa | grep webtob1`
if [ `echo ${OK_CNT1} | awk '{print $4}'` -gt | 1 ]
then
printf "%-22s%3s%s\n" "Web Con Status" " : " "[ OK ]"
else
echo "\033[5m\c"
printf "%-22s%3s%s\n" "Web Con Status" " : " "[ NOT OK ]"
echo "\033[0m\c"
echo "type for check : echo st -server 컨테이너명 -t | /APP/jeus7/bin/dsa "
fi
echo "---------------- Web Server Container Check End ----------------- "
echo
###### WEB Status Check ######
echo "---------------- Web Server Check Start ----------------- "
set -A WEB_STATUS_OK `/APP/jeus7/bin/wsadmin -C si | grep -w RDY | awk '{print $2}'`
set -A WEB_STATUS_NOK `/APP/jeus7/bin/wsadmin -C si | grep -w NRDY | awk '{print $2}'`
OK_CNT=`echo ${WEB_STATUS_OK[@]} | wc -w | tr -d " "`
NOK_CNT=`echo ${WEB_STATUS_NOK[@]} | wc -w | tr -d " "`
i=0
if [ ${OK_CNT} -gt 0 ]
then
for n in ${WEB_STATUS_OK[@]}
do
printf "%-22s%3s%10s\n" "${WEB_STATUS_OK[$i]} " " : " "[ OK ]"
i=$((${i}+1))
done
fi
if [ ${OK_NCNT} -gt 0 ]
then
for n in ${WEB_STATUS_NOK[@]}
do
echo "\033[5m\c"
printf "%-22s%3s%10s\n" "${WEB_STATUS_NOK[$i]} " " : " "[ NOT OK ]"
echo "\033[0m\c"
echo "type for check : /APP/jeus7/bin/wsadmin -C si"
i=$((${i}+1))
done
fi
echo "---------------- Web Server Check End ----------------- "
echo
반응형