티스토리 뷰

#!/bin/sh

PRO_NAME="websphere"

set -A WAS_LIST1 \
Container명1 \
Container명2 \
Container명3 \
Container명4 \
Container명5

set -A WAS_LIST2 \
"Maganer" \
"Container명1 WAS" \
"Container명2 WAS" \
"Container명3 WAS" \
"Container명4 WAS"

echo
echo "------------ WAS Process Check Start ------------"

i=0

for n in ${WAS_LIST1[@]}
do

PS_CNT= `ps -ef | awk '{ AA ="whoami"; AA | getline BB; close(AA); if($1 == BB) print}' | grep ${PRO_NAME} | grep "${n}$" | wc -l | tr -d " "`

if [ ${PS_CNT} -eq 1 ]
then 
	print "%-22s%3s%s\n" "${WAS_LIST2[$i]}  " " : " "[     OK ]"
else
	echo  "\033[5m\c"
    printf "%-22s%3s%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 -----------"

i = 0

for n in ${WAS_LIST1[@]}
do

if [ `/APP/websphere/AppServer/bin/serverStatus.sh ${n} | grep STARTED | wc -l` -eq 1 ]
then 
	printf "%-22s%3%10s\n" "${WAS_LIST2[$i]}  " " : " " [     OK ]"
else
	echo "\033[5m\c"
    printf "%-22s%3s%10s\n" "${WAS_LIST2[$i]} " " : " " [  NOT OK  ]"
    echo "\033[0m\c"
    echo "Type for check : /APP/websphere/AppServer/bin/serverStatus.sh ${n}"
fi

i=$((${i}+1))

done

echo "------------ Container Check End -------------"
echo



###### WEB Server status Check Start ########
echo "------------WEB Service Check Start --------------"

if [ `/APP/websphere/AppServer/bin/serverStatus.sh webserver1 | grep RUNNING | wc -l` -eq 1 ]
then
	printf "%-22s%3s%10s\n" "webserver1" " : " "[     OK ]"
else
	echo "\033[5m\c"
    printf "%-22s%3%10s\n" "webserver1" " : " "[ NOT OK ]"
    echo "\033[0m\c"
    echo "Type for check : /APP/websphere/AppServer/bin/serverStatus.sh webserver1"
fi

echo "------------ WEB Service Check End -----------"
echo
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/07   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
글 보관함