** Myself
## Webshpere with one node and three server
## Menu function.
1) WBS_Monitor_Menu for Monitor process websphere
2) Start_Stop_WBS_Menu for Start/Stop websphere
3) House_Keeping_WBS_Menu for Maintain Log websphere
----------------------------------------------------------------
#!/bin/ksh
### Websphere ENV ###
export webspuser=wasadmin
export websppro=/app/ibm/WebSphere/AppServer/profiles
export StartDmgr1[0]="${websppro}/Dmgr01/bin/startManager.sh"
export StartApp1[0]="${websppro}/AppSrv01/bin/startNode.sh"
export StartApp1[1]="${websppro}/AppSrv01/bin/startServer.sh node1_server1"
export StartApp1[2]="${websppro}/AppSrv01/bin/startServer.sh node1_server2"
export StartApp1[3]="${websppro}/AppSrv01/bin/startServer.sh node1_server3"
export StopDmgr1[0]="${websppro}/Dmgr01/bin/stopManager.sh -user wasadm -password password"
export StopApp1[0]="${websppro}/AppSrv01/bin/stopNode.sh -user wasadm -password password"
export StopApp1[1]="${websppro}/AppSrv01/bin/stopServer.sh node1_server1 -user wasadm -password password"
export StopApp1[2]="${websppro}/AppSrv01/bin/stopServer.sh node1_server2 -user wasadm -password password"
export StopApp1[3]="${websppro}/AppSrv01/bin/stopServer.sh node1_server3 -user wasadm -password password"
export StartDmgr2[0]="${websppro}/Dmgr01/bin/startManager.sh"
export StartApp2[0]="${websppro}/AppSrv01/bin/startNode.sh"
export StartApp2[1]="${websppro}/AppSrv01/bin/startServer.sh node2_server1"
export StartApp2[2]="${websppro}/AppSrv01/bin/startServer.sh node2_server2"
export StartApp2[3]="${websppro}/AppSrv01/bin/startServer.sh node2_server3"
export StopDmgr2[0]="${websppro}/Dmgr01/bin/stopManager.sh -user wasadm -password password"
export StopApp2[0]="${websppro}/AppSrv01/bin/stopNode.sh -user wasadm -password password"
export StopApp2[1]="${websppro}/AppSrv01/bin/stopServer.sh node2_server1 -user wasadm -password password"
export StopApp2[2]="${websppro}/AppSrv01/bin/stopServer.sh node2_server2 -user wasadm -password password"
export StopApp2[3]="${websppro}/AppSrv01/bin/stopServer.sh node2_server3 -user wasadm -password password"
export StatusDmgr1[0]="${websppro}/Dmgr01/bin/serverStatus.sh -all -user wasadm -password password"
export StatusApp1[0]="${websppro}/AppSrv01/bin/serverStatus.sh -all -user wasadm -password password"
# Log Dmgr
export DirLogDmgr1=/app/ibm/WebSphere/AppServer/profiles/Dmgr01/logs/dmgr
export StartLogDmgr1=${DirLogDmgr1}/startServer.log
export StopLogDmgr1=${DirLogDmgr1}/stopServer.log
export SystemOutLogDmgr1=${DirLogDmgr1}/SystemOut.log
export SystemErrLogDmgr1=${DirLogDmgr1}/SystemErr.log
# Log Node1 ServerN
export DirLogN1S1=/app/ibm/WebSphere/AppServer/profiles/AppSrv01/logs/node1_server1
export StartLogN1S1=${DirLogN1S1}/startServer.log
export StopLogN1S1=${DirLogN1S1}/stopServer.log
export SystemOutLogN1S1=${DirLogN1S1}/SystemOut.log
export SystemErrLogN1S1=${DirLogN1S1}/SystemErr.log
export DirLogN1S2=/app/ibm/WebSphere/AppServer/profiles/AppSrv01/logs/node1_server2
export StartLogN1S2=${DirLogN1S2}/startServer.log
export StopLogN1S2=${DirLogN1S2}/stopServer.log
export SystemOutLogN1S2=${DirLogN1S2}/SystemOut.log
export SystemErrLogN1S2=${DirLogN1S2}/SystemErr.log
export DirLogN1S3=/app/ibm/WebSphere/AppServer/profiles/AppSrv01/logs/node1_server3
export StartLogN1S3=${DirLogN1S3}/startServer.log
export StopLogN1S3=${DirLogN1S3}/stopServer.log
export SystemOutLogN1S3=${DirLogN1S3}/SystemOut.log
export SystemErrLogN1S3=${DirLogN1S3}/SystemErr.log
# Log Node2 ServerN
export DirLogN2S1=/app/ibm/WebSphere/AppServer/profiles/AppSrv01/logs/node2_server1
export StartLogN2S1=${DirLogN2S1}/startServer.log
export StopLogN2S1=${DirLogN2S1}/stopServer.log
export SystemOutLogN2S1=${DirLogN2S1}/SystemOut.log
export SystemErrLogN2S1=${DirLogN2S1}/SystemErr.log
export DirLogN2S2=/app/ibm/WebSphere/AppServer/profiles/AppSrv01/logs/node2_server2
export StartLogN2S2=${DirLogN2S2}/startServer.log
export StopLogN2S2=${DirLogN2S2}/stopServer.log
export SystemOutLogN2S2=${DirLogN2S2}/SystemOut.log
export SystemErrLogN2S2=${DirLogN2S2}/SystemErr.log
export DirLogN2S3=/app/ibm/WebSphere/AppServer/profiles/AppSrv01/logs/node2_server3
export StartLogN2S3=${DirLogN2S3}/startServer.log
export StopLogN2S3=${DirLogN2S3}/stopServer.log
export SystemOutLogN2S3=${DirLogN2S3}/SystemOut.log
export SystemErrLogN2S3=${DirLogN2S3}/SystemErr.log
### System ENV ###
export syslogfile=/var/adm/syslog/syslog.log
# Clear all log file
ll /tmp/oper*.* > /dev/null 2>&1
if [ $? -eq 0 ]; then
rm -f /tmp/oper_tm*.*
fi
#====================================================================
#
# 1. SYSTEM MAIN MENU FUNCTION : Operator Menu
#
#====================================================================
system_menu()
{
system_main_menu=0
while [[ ! "x${system_main_menu}x" = "x99x" ]] ; do
clear
echo "========================================"
echo "|--- Operation Menu (`hostname`)"
echo "|--- 1. System Main Menu "
echo "========================================\n"
echo "(1) File System Monitoring Menu and System Log File"
echo "(99) Back\n"
echo "Please select a number from the System Main Menu: \c"
read system_main_menu
case ${system_main_menu} in
1)
Check_Available_FS_Menu
;;
99)
;;
*)
echo "!!! Please select a number from the list !!!"
sleep 1
;;
esac
done
}
#====================================================================
#
# 1.1. CHECK AVAILABLE FILE SYSTEM MENU & SYSTEM LOG FILE FUNCTION: Operator Menu
#
#====================================================================
Check_Available_FS_Menu()
{
check_available_fs_menu=0
while [[ ! "x${check_available_fs_menu}x" = "x99x" ]] ;do
clear
echo "========================================"
echo "|--- Operation Menu (`hostname`) "
echo "|--- 1. System Main Menu "
echo "|--- 1.1 File System Monitoring Menu and System Log File"
echo "================================================================"
echo "(1) View ${syslogfile} Log File"
echo "(2) View Tail ${syslogfile} Log File"
echo "(3) Monitoring the status of File System"
echo "(99) Back\n"
echo "Please select a number from the File System Monitoring Menu: \c"
read check_available_fs_menu
case "${check_available_fs_menu}" in
1)
clear
echo "========================================"
echo "|--- Operation Menu (`hostname`)"
echo "|--- 1. System Main Menu "
echo "|--- 1.1 File System Monitoring Menu and System Log File"
echo "|--- 1.1.1 View ${syslogfile} Log File"
echo "=======================================================\n"
echo "cat /var/adm/syslog/alert_${orasid}.log | pg -p Press Enter to continue: "
cat ${syslogfile} | pg -p "Press Enter to continue: "
read Answer
;;
2)
clear
echo "========================================"
echo "|--- Operation Menu (`hostname`)"
echo "|--- 1. System Main Menu "
echo "|--- 1.1 File System Monitoring Menu and System Log File"
echo "|--- 1.1.2 View Tail ${syslogfile} Log File"
echo "=======================================================\n"
tail -n 200 ${syslogfile} | pg -p "Press Enter to continue: "
read Answer
;;
3)
clear
echo "========================================"
echo "|--- Operation Menu (`hostname`)"
echo "|--- 1. System Main Menu "
echo "|--- 1.1 File System Monitoring Menu and System Log File"
echo "|--- 1.1.3 Available File System "
echo "=======================================================\n"
bdf
echo
echo "======================================================="
echo "|------------------ Expected Result ------------------|"
echo "=======================================================\n"
echo " %used is not more than 80%"
echo "======================================================="
echo "Press enter to continue: \c"
read waiting
;;
99)
;;
*)
echo "!!! Please select a number from the list !!!"
sleep 1
;;
esac
done
}
#====================================================================
#
# 2. WEBSPHERE MAIN MENU FUNCTION : Operator Menu
#
#====================================================================
websphere_menu()
{
websphere_main_menu=0
while [[ ! "x${websphere_main_menu}x" = "x99x" ]] ; do
clear
echo "========================================"
echo "|--- Operation Menu (`hostname`) "
echo "|--- 2. Websphere Main Menu"
echo "========================================\n"
echo "(1) Websphere Monitoring Menu"
echo "(2) Start/Stop Websphere Services Menu"
echo "(3) Maintain Log Websphere Menu"
echo "(99) Back\n"
echo "Please select a number from the Websphere Main Menu: \c"
read websphere_main_menu
case "$websphere_main_menu" in
1)
WBS_Monitor_Menu
;;
2)
Start_Stop_WBS_Menu
;;
3)
House_Keeping_WBS_Menu
;;
99)
;;
*)
echo "!!! Please select a number from the list !!!"
sleep 1
;;
esac
done
}
#====================================================================
#
# 2.1. Websphere MOINTORING MENU FUNCTION : Operator Menu
#
#====================================================================
WBS_Monitor_Menu()
{
wbs_monitor_menu=0
while [[ ! "x${wbs_monitor_menu}x" = "x99x" ]] ;do
clear
echo "========================================"
echo "|--- Operation Menu (`hostname`) "
echo "|--- 2. Websphere Main Menu "
echo "|--- 2.1 Websphere Monitoring Menu"
echo "=================================================\n"
echo "(1) Monitoring the status of Deployment Manager Service"
echo "(2) Monitoring the status of Application Server Service"
echo "(99) Back\n"
echo "Please select a number from the Service Monitoring Menu: \c"
read wbs_monitor_menu
case "${wbs_monitor_menu}" in
1)
clear
echo "========================================"
echo "|--- Operation Menu (`hostname`) "
echo "|--- 2. Websphere Main Menu "
echo "|--- 2.1 Websphere Monitoring Menu"
echo "|--- 2.1.1 Monitoring the status of Deployment Manager Service"
echo "===========================================================\n"
i=0
> /tmp/oper_tmp2.sh
while (( i < ${#StatusDmgr1[*]} ))
do
echo "${StatusDmgr1[${i}]}" >> /tmp/oper_tmp2.sh
(( i = i + 1 ))
done
ssh ${webspuser}@127.0.0.1 < /tmp/oper_tmp2.sh
echo "Press enter to continue: \c"
echo
echo "=========================================================="
echo "|-------------------- Expected Result -------------------|"
echo "==========================================================\n"
echo " Deployment Manager Service status should be STARTED"
echo "==========================================================\n"
echo "Press enter to continue: \c"
read waiting
;;
2)
clear
echo "========================================"
echo "|--- Operation Menu (`hostname`) "
echo "|--- 2. Websphere Main Menu "
echo "|--- 2.1 Websphere Monitoring Menu"
echo "|--- 2.1.2 Monitoring the status of Application Server Service"
echo "===========================================================\n"
i=0
> /tmp/oper_tmp2.sh
while (( i < ${#StatusApp1[*]} ))
do
echo "$StatusApp1{[${i}]}" >> /tmp/oper_tmp2.sh
(( i = i + 1 ))
done
ssh ${webspuser}@127.0.0.1 < /tmp/oper_tmp2.sh
echo "Press enter to continue: \c"
echo
echo "=========================================================="
echo "|-------------------- Expected Result -------------------|"
echo "==========================================================\n"
echo " Application Server Service status should be STARTED"
echo "==========================================================\n"
echo "Press enter to continue: \c"
read waiting
;;
99)
;;
*)
echo "!!! Please select a number from the list !!!"
sleep 1
;;
esac
done
}
#====================================================================
#
# 2.2. Websphere START/STOP MENU FUNCTION : Operator Menu
#
#====================================================================
Start_Stop_WBS_Menu()
{
start_stop_wbs_menu=0
while [[ ! "x${start_stop_wbs_menu}x" = "x99x" ]]; do
clear
echo "========================================"
echo "|--- Operation Menu (`hostname`) "
echo "|--- 2. Websphere Main Menu "
echo "|--- 2.2 Start/Stop Deployment & Application Server Menu "
echo "=================================================\n"
echo "(1) Start Deployment Manager Service"
echo "(2) Stop Deployment Manager Service"
echo "(3) Start Application Server Service"
echo "(4) Stop Application Server Service"
echo "(99) Back\n"
echo "Please select a number from the Start/Stop Service Menu: \c"
read start_stop_wbs_menu
case ${start_stop_wbs_menu} in
1)
echo "Are you sure you want to start Deployment Manager Service on `hostname`? [N/y]: \c"
read Answer
if [ "${Answer:="N"}" = "y" -o "${Answer:="N"}" = "Y" -o "${Answer:="N"}" = "yes" -o "${Answer:="N"}" = "Yes" ] ; then
i=0
> /tmp/oper_tmp2.sh
while (( i < ${#StartDmgr1[*]} ))
do
echo "${StartDmgr1[${i}]}" >> /tmp/oper_tmp2.sh
(( i = i + 1 ))
done
ssh ${webspuser}@127.0.0.1 < /tmp/oper_tmp2.sh
echo "Press enter to continue: \c"
read waiting
elif [ "${Answer:="N"}" != "n" -a "${Answer:="N"}" != "N" -a "${Answer:="N"}" != "no" -a "${Answer:="N"}" != "No" ] ; then
echo "!!! Please choose Yes or No !!!"
sleep 1
fi
;;
2)
echo "Are you sure you want to stop Deployment Manager Service on `hostname`? [N/y]: \c"
read Answer
if [ "${Answer:="N"}" = "y" -o "${Answer:="N"}" = "Y" -o "${Answer:="N"}" = "yes" -o "${Answer:="N"}" = "Yes" ] ; then
i=0
> /tmp/oper_tmp2.sh
while (( i < ${#StopDmgr1[*]} ))
do
echo "${StopDmgr1[${i}]}" >> /tmp/oper_tmp2.sh
(( i = i + 1 ))
done
ssh ${webspuser}@127.0.0.1 < /tmp/oper_tmp2.sh
echo "Press enter to continue: \c"
read waiting
elif [ "${Answer:="N"}" != "n" -a "${Answer:="N"}" != "N" -a "${Answer:="N"}" != "no" -a "${Answer:="N"}" != "No" ] ; then
echo "!!! Please choose Yes or No !!!"
sleep 1
fi
;;
3)
echo "Are you sure you want to start Application Server on `hostname`? [N/y]: \c"
read Answer
if [ "${Answer:="N"}" = "y" -o "${Answer:="N"}" = "Y" -o "${Answer:="N"}" = "yes" -o "${Answer:="N"}" = "Yes" ] ; then
i=0
> /tmp/oper_tmp2.sh
while (( i < ${#StartApp1[*]} ))
do
echo "${StartApp1[${i}]}" >> /tmp/oper_tmp2.sh
(( i = i + 1 ))
done
ssh ${webspuser}@127.0.0.1 < /tmp/oper_tmp2.sh
echo "Press enter to continue: \c"
read waiting
elif [ "${Answer:="N"}" != "n" -a "${Answer:="N"}" != "N" -a "${Answer:="N"}" != "no" -a "${Answer:="N"}" != "No" ] ; then
echo "!!! Please choose Yes or No !!!"
sleep 1
fi
;;
4)
echo "Are you sure you want to stop Application Server on `hostname`? [N/y]: \c"
read Answer
if [ "${Answer:="N"}" = "y" -o "${Answer:="N"}" = "Y" -o "${Answer:="N"}" = "yes" -o "${Answer:="N"}" = "Yes" ] ; then
i=0
> /tmp/oper_tmp2.sh
while (( i < ${#StopApp1[*]} ))
do
echo "${StopApp1[${i}]}" >> /tmp/oper_tmp2.sh
(( i = i + 1 ))
done
ssh ${webspuser}@127.0.0.1 < /tmp/oper_tmp2.sh
echo "Press enter to continue: \c"
read waiting
elif [ "${Answer:="N"}" != "n" -a "${Answer:="N"}" != "N" -a "${Answer:="N"}" != "no" -a "${Answer:="N"}" != "No" ] ; then
echo "!!! Please choose Yes or No !!!"
sleep 1
fi
;;
99)
;;
*)
echo "!!!Please select a number from the list!!!"
sleep 1
;;
esac
done
}
#====================================================================
#
# 2.3. HOUSE KEEPING WEBSPHERE MENU FUNCTION : Operator Menu
#
#====================================================================
House_Keeping_WBS_Menu()
{
house_keeping_wbs_menu=0
while [[ ! "x${house_keeping_wbs_menu}x" = "x99x" ]] ; do
clear
echo "==========================================="
echo "|--- Operation Menu (`hostname`) "
echo "|--- 2. Websphere Main Menu "
echo "|--- 2.3 Maintain Log Websphere Menu "
echo "===========================================\n"
echo " (1) View Tail Start Deployment Manager Log File"
echo " (2) View Tail Stop Deployment Manager Log File"
echo " (3) View Tail SystemOut Deployment Manager Log File"
echo " (4) View Tail SystemErr Deployment Manager Log File"
echo "-------------------------------------------"
if [ "$(hostname)" = "servs05" ]; then
echo " (5) View Tail Start AppServer Node1 Server1 Log File"
else
echo " (5) View Tail Start AppServer Node2 Server1 Log File"
fi
if [ "$(hostname)" = "servs05" ]; then
echo " (6) View Tail Stop AppServer Node1 Server1 Log File"
else
echo " (6) View Tail Stop AppServer Node2 Server1 Log File"
fi
if [ "$(hostname)" = "servs05" ]; then
echo " (7) View Tail SystemOut AppServer Node1 Server1 Log File"
else
echo " (7) View Tail SystemOut AppServer Node2 Server1 Log File"
fi
if [ "$(hostname)" = "servs05" ]; then
echo " (8) View Tail SystemErr AppServer Node1 Server1 Log File"
else
echo " (8) View Tail SystemErr AppServer Node2 Server1 Log File"
fi
echo "-------------------------------------------"
if [ "$(hostname)" = "servs05" ]; then
echo " (9) View Tail Start AppServer Node1 Server2 Log File"
else
echo " (9) View Tail Start AppServer Node2 Server2 Log File"
fi
if [ "$(hostname)" = "servs05" ]; then
echo "(10) View Tail Stop AppServer Node1 Server2 Log File"
else
echo "(10) View Tail Stop AppServer Node2 Server2 Log File"
fi
if [ "$(hostname)" = "servs05" ]; then
echo "(11) View Tail SystemOut AppServer Node1 Server2 Log File"
else
echo "(11) View Tail SystemOut AppServer Node2 Server2 Log File"
fi
if [ "$(hostname)" = "servs05" ]; then
echo "(12) View Tail SystemErr AppServer Node1 Server2 Log File"
else
echo "(12) View Tail SystemErr AppServer Node2 Server2 Log File"
fi
echo "-------------------------------------------"
if [ "$(hostname)" = "servs05" ]; then
echo "(13) View Tail Start AppServer Node1 Server3 Log File"
else
echo "(13) View Tail Start AppServer Node2 Server3 Log File"
fi
if [ "$(hostname)" = "servs05" ]; then
echo "(14) View Tail Stop AppServer Node1 Server3 Log File"
else
echo "(14) View Tail Stop AppServer Node2 Server3 Log File"
fi
if [ "$(hostname)" = "servs05" ]; then
echo "(15) View Tail SystemOut AppServer Node1 Server3 Log File"
else
echo "(15) View Tail SystemOut AppServer Node2 Server3 Log File"
fi
if [ "$(hostname)" = "servs05" ]; then
echo "(16) View Tail SystemErr AppServer Node1 Server3 Log File"
else
echo "(16) View Tail SystemErr AppServer Node2 Server3 Log File"
fi
echo "(99) Back\n"
echo "Please select a number from the Maintain Log Webshpere Menu: \c"
read house_keeping_wbs_menu
case "$house_keeping_wbs_menu" in
1)
clear
echo "==========================================="
echo "|--- Operation Menu (`hostname`) "
echo "|--- 2. Websphere Main Menu "
echo "|--- 2.3 Maintain Log Websphere Menu "
echo "|--- 2.3.1 View Tail Start Deployment Manager Log File"
echo "===========================================\n"
tail -n 200 ${StartLogDmgr1} | pg -p "Press Enter to continue: "
echo "===========================================\n"
echo "Press enter to continue: \c"
read Answer
;;
2)
clear
echo "==========================================="
echo "|--- Operation Menu (`hostname`) "
echo "|--- 2. Websphere Main Menu "
echo "|--- 2.3 Maintain Log Websphere Menu "
echo "|--- 2.3.2 View Tail Stop Deployment Manager Log File"
echo "===========================================\n"
tail -n 200 ${StopLogDmgr1} | pg -p "Press Enter to continue: "
echo "===========================================\n"
echo "Press enter to continue: \c"
read Answer
;;
3)
clear
echo "==========================================="
echo "|--- Operation Menu (`hostname`) "
echo "|--- 2. Websphere Main Menu "
echo "|--- 2.3 Maintain Log Websphere Menu "
echo "|--- 2.3.3 View Tail SystemOut Deployment Manager Log File"
echo "===========================================\n"
tail -n 200 ${SystemOutLogDmgr1} | pg -p "Press Enter to continue: "
echo "===========================================\n"
echo "Press enter to continue: \c"
read Answer
;;
4)
clear
echo "==========================================="
echo "|--- Operation Menu (`hostname`) "
echo "|--- 2. Websphere Main Menu "
echo "|--- 2.3 Maintain Log Websphere Menu "
echo "|--- 2.3.4 View Tail SystemErr Deployment Manager Log File"
echo "===========================================\n"
tail -n 200 ${SystemErrLogDmgr1} | pg -p "Press Enter to continue: "
echo "===========================================\n"
echo "Press enter to continue: \c"
read Answer
;;
5)
clear
echo "==========================================="
echo "|--- Operation Menu (`hostname`) "
echo "|--- 2. Websphere Main Menu "
echo "|--- 2.3 Maintain Log Websphere Menu "
if [ "$(hostname)" = "servs05" ]; then
echo "|--- 2.3.5 View Tail Start AppServer Node1 Server1 Log File"
tail -n 200 ${StartLogN1S1} | pg -p "Press Enter to continue: "
else
echo "|--- 2.3.5 View Tail Start AppServer Node2 Server1 Log File"
tail -n 200 ${StartLogN2S1} | pg -p "Press Enter to continue: "
fi
echo "===========================================\n"
echo "Press enter to continue: \c"
read Answer
;;
6)
clear
echo "==========================================="
echo "|--- Operation Menu (`hostname`) "
echo "|--- 2. Websphere Main Menu "
echo "|--- 2.3 Maintain Log Websphere Menu "
if [ "$(hostname)" = "servs05" ]; then
echo "|--- 2.3.6 View Tail Stop AppServer Node1 Server1 Log File"
tail -n 200 ${StopLogN1S1} | pg -p "Press Enter to continue: "
else
echo "|--- 2.3.6 View Tail Start AppServer Node2 Server1 Log File"
tail -n 200 ${StopLogN2S1} | pg -p "Press Enter to continue: "
fi
echo "===========================================\n"
echo "Press enter to continue: \c"
read Answer
;;
7)
clear
echo "==========================================="
echo "|--- Operation Menu (`hostname`) "
echo "|--- 2. Websphere Main Menu "
echo "|--- 2.3 Maintain Log Websphere Menu "
if [ "$(hostname)" = "servs05" ]; then
echo "|--- 2.3.7 View Tail SystemOut AppServer Node1 Server1 Log File"
tail -n 200 ${SystemOutLogN1S1} | pg -p "Press Enter to continue: "
else
echo "|--- 2.3.7 View Tail SystemOut AppServer Node2 Server1 Log File"
tail -n 200 ${SystemOutLogN2S1} | pg -p "Press Enter to continue: "
fi
echo "===========================================\n"
echo "Press enter to continue: \c"
read Answer
;;
8)
clear
echo "==========================================="
echo "|--- Operation Menu (`hostname`) "
echo "|--- 2. Websphere Main Menu "
echo "|--- 2.3 Maintain Log Websphere Menu "
if [ "$(hostname)" = "servs05" ]; then
echo "|--- 2.3.8 View Tail SystemErr AppServer Node1 Server1 Log File"
tail -n 200 ${SystemErrLogN1S1} | pg -p "Press Enter to continue: "
else
echo "|--- 2.3.8 View Tail SystemErr AppServer Node2 Server1 Log File"
tail -n 200 ${SystemErrLogN2S1} | pg -p "Press Enter to continue: "
fi
echo "===========================================\n"
echo "Press enter to continue: \c"
read Answer
;;
9)
clear
echo "==========================================="
echo "|--- Operation Menu (`hostname`) "
echo "|--- 2. Websphere Main Menu "
echo "|--- 2.3 Maintain Log Websphere Menu "
if [ "$(hostname)" = "servs05" ]; then
echo "|--- 2.3.9 View Tail Start AppServer Node1 Server2 Log File"
tail -n 200 ${StartLogN1S2} | pg -p "Press Enter to continue: "
else
echo "|--- 2.3.9 View Tail Start AppServer Node2 Server2 Log File"
tail -n 200 ${StartLogN2S2} | pg -p "Press Enter to continue: "
fi
echo "===========================================\n"
echo "Press enter to continue: \c"
read Answer
;;
10)
clear
echo "==========================================="
echo "|--- Operation Menu (`hostname`) "
echo "|--- 2. Websphere Main Menu "
echo "|--- 2.3 Maintain Log Websphere Menu "
if [ "$(hostname)" = "servs05" ]; then
echo "|--- 2.3.10 View Tail Stop AppServer Node1 Server2 Log File"
tail -n 200 ${StopLogN1S2} | pg -p "Press Enter to continue: "
else
echo "|--- 2.3.10 View Tail Start AppServer Node2 Server2 Log File"
tail -n 200 ${StopLogN2S2} | pg -p "Press Enter to continue: "
fi
echo "===========================================\n"
echo "Press enter to continue: \c"
read Answer
;;
11)
clear
echo "==========================================="
echo "|--- Operation Menu (`hostname`) "
echo "|--- 2. Websphere Main Menu "
echo "|--- 2.3 Maintain Log Websphere Menu "
if [ "$(hostname)" = "servs05" ]; then
echo "|--- 2.3.11 View Tail SystemOut AppServer Node1 Server2 Log File"
tail -n 200 ${SystemOutLogN1S2} | pg -p "Press Enter to continue: "
else
echo "|--- 2.3.11 View Tail SystemOut AppServer Node2 Server2 Log File"
tail -n 200 ${SystemOutLogN2S2} | pg -p "Press Enter to continue: "
fi
echo "===========================================\n"
echo "Press enter to continue: \c"
read Answer
;;
12)
clear
echo "==========================================="
echo "|--- Operation Menu (`hostname`) "
echo "|--- 2. Websphere Main Menu "
echo "|--- 2.3 Maintain Log Websphere Menu "
if [ "$(hostname)" = "servs05" ]; then
echo "|--- 2.3.12 View Tail SystemErr AppServer Node1 Server2 Log File"
tail -n 200 ${SystemErrLogN1S2} | pg -p "Press Enter to continue: "
else
echo "|--- 2.3.12 View Tail SystemErr AppServer Node2 Server2 Log File"
tail -n 200 ${SystemErrLogN2S2} | pg -p "Press Enter to continue: "
fi
echo "===========================================\n"
echo "Press enter to continue: \c"
read Answer
;;
13)
clear
echo "==========================================="
echo "|--- Operation Menu (`hostname`) "
echo "|--- 2. Websphere Main Menu "
echo "|--- 2.3 Maintain Log Websphere Menu "
if [ "$(hostname)" = "servs05" ]; then
echo "|--- 2.3.13 View Tail Start AppServer Node1 Server3 Log File"
tail -n 200 ${StartLogN1S3} | pg -p "Press Enter to continue: "
else
echo "|--- 2.3.13 View Tail Start AppServer Node2 Server3 Log File"
tail -n 200 ${StartLogN2S3} | pg -p "Press Enter to continue: "
fi
echo "===========================================\n"
echo "Press enter to continue: \c"
read Answer
;;
14)
clear
echo "==========================================="
echo "|--- Operation Menu (`hostname`) "
echo "|--- 2. Websphere Main Menu "
echo "|--- 2.3 Maintain Log Websphere Menu "
if [ "$(hostname)" = "servs05" ]; then
echo "|--- 2.3.14 View Tail Stop AppServer Node1 Server3 Log File"
tail -n 200 ${StopLogN1S3} | pg -p "Press Enter to continue: "
else
echo "|--- 2.3.14 View Tail Start AppServer Node2 Server3 Log File"
tail -n 200 ${StopLogN2S3} | pg -p "Press Enter to continue: "
fi
echo "===========================================\n"
echo "Press enter to continue: \c"
read Answer
;;
15)
clear
echo "==========================================="
echo "|--- Operation Menu (`hostname`) "
echo "|--- 2. Websphere Main Menu "
echo "|--- 2.3 Maintain Log Websphere Menu "
if [ "$(hostname)" = "servs05" ]; then
echo "|--- 2.3.15 View Tail SystemOut AppServer Node1 Server3 Log File"
tail -n 200 ${SystemOutLogN1S3} | pg -p "Press Enter to continue: "
else
echo "|--- 2.3.15 View Tail SystemOut AppServer Node2 Server3 Log File"
tail -n 200 ${SystemOutLogN2S3} | pg -p "Press Enter to continue: "
fi
echo "===========================================\n"
echo "Press enter to continue: \c"
read Answer
;;
16)
clear
echo "==========================================="
echo "|--- Operation Menu (`hostname`) "
echo "|--- 2. Websphere Main Menu "
echo "|--- 2.3 Maintain Log Websphere Menu "
if [ "$(hostname)" = "servs05" ]; then
echo "|--- 2.3.16 View Tail SystemErr AppServer Node1 Server3 Log File"
tail -n 200 ${SystemErrLogN1S3} | pg -p "Press Enter to continue: "
else
echo "|--- 2.3.16 View Tail SystemErr AppServer Node2 Server3 Log File"
tail -n 200 ${SystemErrLogN2S3} | pg -p "Press Enter to continue: "
fi
echo "===========================================\n"
echo "Press enter to continue: \c"
read Answer
;;
99)
;;
*)
echo "!!! Please select a number from the list !!!"
sleep 1
;;
esac
done
}
#====================================================================
#
# MAIN PROGRAM: Operator Menu
#
# PURPOSE: Checks for system instances and
# startup/shutdown system instances
#
#====================================================================
operation_menu=0
while [[ ! "x${operation_menu}x" = "x99x" ]] ; do
clear
echo "========================================"
echo "|--- Operation Menu (`hostname`) "
echo "========================================\n"
echo "(1) System Main Menu"
echo "(2) Websphere Main Menu"
echo "(99) Exit\n"
echo "Please select a number from the Operation Menu: \c"
read operation_menu
case ${operation_menu} in
1)
system_menu
;;
2)
websphere_menu
;;
99)
;;
*)
echo "!!! Please select a number from the list !!!"
sleep 1
;;
esac
done
## Webshpere with one node and three server
## Menu function.
1) WBS_Monitor_Menu for Monitor process websphere
2) Start_Stop_WBS_Menu for Start/Stop websphere
3) House_Keeping_WBS_Menu for Maintain Log websphere
----------------------------------------------------------------
#!/bin/ksh
### Websphere ENV ###
export webspuser=wasadmin
export websppro=/app/ibm/WebSphere/AppServer/profiles
export StartDmgr1[0]="${websppro}/Dmgr01/bin/startManager.sh"
export StartApp1[0]="${websppro}/AppSrv01/bin/startNode.sh"
export StartApp1[1]="${websppro}/AppSrv01/bin/startServer.sh node1_server1"
export StartApp1[2]="${websppro}/AppSrv01/bin/startServer.sh node1_server2"
export StartApp1[3]="${websppro}/AppSrv01/bin/startServer.sh node1_server3"
export StopDmgr1[0]="${websppro}/Dmgr01/bin/stopManager.sh -user wasadm -password password"
export StopApp1[0]="${websppro}/AppSrv01/bin/stopNode.sh -user wasadm -password password"
export StopApp1[1]="${websppro}/AppSrv01/bin/stopServer.sh node1_server1 -user wasadm -password password"
export StopApp1[2]="${websppro}/AppSrv01/bin/stopServer.sh node1_server2 -user wasadm -password password"
export StopApp1[3]="${websppro}/AppSrv01/bin/stopServer.sh node1_server3 -user wasadm -password password"
export StartDmgr2[0]="${websppro}/Dmgr01/bin/startManager.sh"
export StartApp2[0]="${websppro}/AppSrv01/bin/startNode.sh"
export StartApp2[1]="${websppro}/AppSrv01/bin/startServer.sh node2_server1"
export StartApp2[2]="${websppro}/AppSrv01/bin/startServer.sh node2_server2"
export StartApp2[3]="${websppro}/AppSrv01/bin/startServer.sh node2_server3"
export StopDmgr2[0]="${websppro}/Dmgr01/bin/stopManager.sh -user wasadm -password password"
export StopApp2[0]="${websppro}/AppSrv01/bin/stopNode.sh -user wasadm -password password"
export StopApp2[1]="${websppro}/AppSrv01/bin/stopServer.sh node2_server1 -user wasadm -password password"
export StopApp2[2]="${websppro}/AppSrv01/bin/stopServer.sh node2_server2 -user wasadm -password password"
export StopApp2[3]="${websppro}/AppSrv01/bin/stopServer.sh node2_server3 -user wasadm -password password"
export StatusDmgr1[0]="${websppro}/Dmgr01/bin/serverStatus.sh -all -user wasadm -password password"
export StatusApp1[0]="${websppro}/AppSrv01/bin/serverStatus.sh -all -user wasadm -password password"
# Log Dmgr
export DirLogDmgr1=/app/ibm/WebSphere/AppServer/profiles/Dmgr01/logs/dmgr
export StartLogDmgr1=${DirLogDmgr1}/startServer.log
export StopLogDmgr1=${DirLogDmgr1}/stopServer.log
export SystemOutLogDmgr1=${DirLogDmgr1}/SystemOut.log
export SystemErrLogDmgr1=${DirLogDmgr1}/SystemErr.log
# Log Node1 ServerN
export DirLogN1S1=/app/ibm/WebSphere/AppServer/profiles/AppSrv01/logs/node1_server1
export StartLogN1S1=${DirLogN1S1}/startServer.log
export StopLogN1S1=${DirLogN1S1}/stopServer.log
export SystemOutLogN1S1=${DirLogN1S1}/SystemOut.log
export SystemErrLogN1S1=${DirLogN1S1}/SystemErr.log
export DirLogN1S2=/app/ibm/WebSphere/AppServer/profiles/AppSrv01/logs/node1_server2
export StartLogN1S2=${DirLogN1S2}/startServer.log
export StopLogN1S2=${DirLogN1S2}/stopServer.log
export SystemOutLogN1S2=${DirLogN1S2}/SystemOut.log
export SystemErrLogN1S2=${DirLogN1S2}/SystemErr.log
export DirLogN1S3=/app/ibm/WebSphere/AppServer/profiles/AppSrv01/logs/node1_server3
export StartLogN1S3=${DirLogN1S3}/startServer.log
export StopLogN1S3=${DirLogN1S3}/stopServer.log
export SystemOutLogN1S3=${DirLogN1S3}/SystemOut.log
export SystemErrLogN1S3=${DirLogN1S3}/SystemErr.log
# Log Node2 ServerN
export DirLogN2S1=/app/ibm/WebSphere/AppServer/profiles/AppSrv01/logs/node2_server1
export StartLogN2S1=${DirLogN2S1}/startServer.log
export StopLogN2S1=${DirLogN2S1}/stopServer.log
export SystemOutLogN2S1=${DirLogN2S1}/SystemOut.log
export SystemErrLogN2S1=${DirLogN2S1}/SystemErr.log
export DirLogN2S2=/app/ibm/WebSphere/AppServer/profiles/AppSrv01/logs/node2_server2
export StartLogN2S2=${DirLogN2S2}/startServer.log
export StopLogN2S2=${DirLogN2S2}/stopServer.log
export SystemOutLogN2S2=${DirLogN2S2}/SystemOut.log
export SystemErrLogN2S2=${DirLogN2S2}/SystemErr.log
export DirLogN2S3=/app/ibm/WebSphere/AppServer/profiles/AppSrv01/logs/node2_server3
export StartLogN2S3=${DirLogN2S3}/startServer.log
export StopLogN2S3=${DirLogN2S3}/stopServer.log
export SystemOutLogN2S3=${DirLogN2S3}/SystemOut.log
export SystemErrLogN2S3=${DirLogN2S3}/SystemErr.log
### System ENV ###
export syslogfile=/var/adm/syslog/syslog.log
# Clear all log file
ll /tmp/oper*.* > /dev/null 2>&1
if [ $? -eq 0 ]; then
rm -f /tmp/oper_tm*.*
fi
#====================================================================
#
# 1. SYSTEM MAIN MENU FUNCTION : Operator Menu
#
#====================================================================
system_menu()
{
system_main_menu=0
while [[ ! "x${system_main_menu}x" = "x99x" ]] ; do
clear
echo "========================================"
echo "|--- Operation Menu (`hostname`)"
echo "|--- 1. System Main Menu "
echo "========================================\n"
echo "(1) File System Monitoring Menu and System Log File"
echo "(99) Back\n"
echo "Please select a number from the System Main Menu: \c"
read system_main_menu
case ${system_main_menu} in
1)
Check_Available_FS_Menu
;;
99)
;;
*)
echo "!!! Please select a number from the list !!!"
sleep 1
;;
esac
done
}
#====================================================================
#
# 1.1. CHECK AVAILABLE FILE SYSTEM MENU & SYSTEM LOG FILE FUNCTION: Operator Menu
#
#====================================================================
Check_Available_FS_Menu()
{
check_available_fs_menu=0
while [[ ! "x${check_available_fs_menu}x" = "x99x" ]] ;do
clear
echo "========================================"
echo "|--- Operation Menu (`hostname`) "
echo "|--- 1. System Main Menu "
echo "|--- 1.1 File System Monitoring Menu and System Log File"
echo "================================================================"
echo "(1) View ${syslogfile} Log File"
echo "(2) View Tail ${syslogfile} Log File"
echo "(3) Monitoring the status of File System"
echo "(99) Back\n"
echo "Please select a number from the File System Monitoring Menu: \c"
read check_available_fs_menu
case "${check_available_fs_menu}" in
1)
clear
echo "========================================"
echo "|--- Operation Menu (`hostname`)"
echo "|--- 1. System Main Menu "
echo "|--- 1.1 File System Monitoring Menu and System Log File"
echo "|--- 1.1.1 View ${syslogfile} Log File"
echo "=======================================================\n"
echo "cat /var/adm/syslog/alert_${orasid}.log | pg -p Press Enter to continue: "
cat ${syslogfile} | pg -p "Press Enter to continue: "
read Answer
;;
2)
clear
echo "========================================"
echo "|--- Operation Menu (`hostname`)"
echo "|--- 1. System Main Menu "
echo "|--- 1.1 File System Monitoring Menu and System Log File"
echo "|--- 1.1.2 View Tail ${syslogfile} Log File"
echo "=======================================================\n"
tail -n 200 ${syslogfile} | pg -p "Press Enter to continue: "
read Answer
;;
3)
clear
echo "========================================"
echo "|--- Operation Menu (`hostname`)"
echo "|--- 1. System Main Menu "
echo "|--- 1.1 File System Monitoring Menu and System Log File"
echo "|--- 1.1.3 Available File System "
echo "=======================================================\n"
bdf
echo
echo "======================================================="
echo "|------------------ Expected Result ------------------|"
echo "=======================================================\n"
echo " %used is not more than 80%"
echo "======================================================="
echo "Press enter to continue: \c"
read waiting
;;
99)
;;
*)
echo "!!! Please select a number from the list !!!"
sleep 1
;;
esac
done
}
#====================================================================
#
# 2. WEBSPHERE MAIN MENU FUNCTION : Operator Menu
#
#====================================================================
websphere_menu()
{
websphere_main_menu=0
while [[ ! "x${websphere_main_menu}x" = "x99x" ]] ; do
clear
echo "========================================"
echo "|--- Operation Menu (`hostname`) "
echo "|--- 2. Websphere Main Menu"
echo "========================================\n"
echo "(1) Websphere Monitoring Menu"
echo "(2) Start/Stop Websphere Services Menu"
echo "(3) Maintain Log Websphere Menu"
echo "(99) Back\n"
echo "Please select a number from the Websphere Main Menu: \c"
read websphere_main_menu
case "$websphere_main_menu" in
1)
WBS_Monitor_Menu
;;
2)
Start_Stop_WBS_Menu
;;
3)
House_Keeping_WBS_Menu
;;
99)
;;
*)
echo "!!! Please select a number from the list !!!"
sleep 1
;;
esac
done
}
#====================================================================
#
# 2.1. Websphere MOINTORING MENU FUNCTION : Operator Menu
#
#====================================================================
WBS_Monitor_Menu()
{
wbs_monitor_menu=0
while [[ ! "x${wbs_monitor_menu}x" = "x99x" ]] ;do
clear
echo "========================================"
echo "|--- Operation Menu (`hostname`) "
echo "|--- 2. Websphere Main Menu "
echo "|--- 2.1 Websphere Monitoring Menu"
echo "=================================================\n"
echo "(1) Monitoring the status of Deployment Manager Service"
echo "(2) Monitoring the status of Application Server Service"
echo "(99) Back\n"
echo "Please select a number from the Service Monitoring Menu: \c"
read wbs_monitor_menu
case "${wbs_monitor_menu}" in
1)
clear
echo "========================================"
echo "|--- Operation Menu (`hostname`) "
echo "|--- 2. Websphere Main Menu "
echo "|--- 2.1 Websphere Monitoring Menu"
echo "|--- 2.1.1 Monitoring the status of Deployment Manager Service"
echo "===========================================================\n"
i=0
> /tmp/oper_tmp2.sh
while (( i < ${#StatusDmgr1[*]} ))
do
echo "${StatusDmgr1[${i}]}" >> /tmp/oper_tmp2.sh
(( i = i + 1 ))
done
ssh ${webspuser}@127.0.0.1 < /tmp/oper_tmp2.sh
echo "Press enter to continue: \c"
echo
echo "=========================================================="
echo "|-------------------- Expected Result -------------------|"
echo "==========================================================\n"
echo " Deployment Manager Service status should be STARTED"
echo "==========================================================\n"
echo "Press enter to continue: \c"
read waiting
;;
2)
clear
echo "========================================"
echo "|--- Operation Menu (`hostname`) "
echo "|--- 2. Websphere Main Menu "
echo "|--- 2.1 Websphere Monitoring Menu"
echo "|--- 2.1.2 Monitoring the status of Application Server Service"
echo "===========================================================\n"
i=0
> /tmp/oper_tmp2.sh
while (( i < ${#StatusApp1[*]} ))
do
echo "$StatusApp1{[${i}]}" >> /tmp/oper_tmp2.sh
(( i = i + 1 ))
done
ssh ${webspuser}@127.0.0.1 < /tmp/oper_tmp2.sh
echo "Press enter to continue: \c"
echo
echo "=========================================================="
echo "|-------------------- Expected Result -------------------|"
echo "==========================================================\n"
echo " Application Server Service status should be STARTED"
echo "==========================================================\n"
echo "Press enter to continue: \c"
read waiting
;;
99)
;;
*)
echo "!!! Please select a number from the list !!!"
sleep 1
;;
esac
done
}
#====================================================================
#
# 2.2. Websphere START/STOP MENU FUNCTION : Operator Menu
#
#====================================================================
Start_Stop_WBS_Menu()
{
start_stop_wbs_menu=0
while [[ ! "x${start_stop_wbs_menu}x" = "x99x" ]]; do
clear
echo "========================================"
echo "|--- Operation Menu (`hostname`) "
echo "|--- 2. Websphere Main Menu "
echo "|--- 2.2 Start/Stop Deployment & Application Server Menu "
echo "=================================================\n"
echo "(1) Start Deployment Manager Service"
echo "(2) Stop Deployment Manager Service"
echo "(3) Start Application Server Service"
echo "(4) Stop Application Server Service"
echo "(99) Back\n"
echo "Please select a number from the Start/Stop Service Menu: \c"
read start_stop_wbs_menu
case ${start_stop_wbs_menu} in
1)
echo "Are you sure you want to start Deployment Manager Service on `hostname`? [N/y]: \c"
read Answer
if [ "${Answer:="N"}" = "y" -o "${Answer:="N"}" = "Y" -o "${Answer:="N"}" = "yes" -o "${Answer:="N"}" = "Yes" ] ; then
i=0
> /tmp/oper_tmp2.sh
while (( i < ${#StartDmgr1[*]} ))
do
echo "${StartDmgr1[${i}]}" >> /tmp/oper_tmp2.sh
(( i = i + 1 ))
done
ssh ${webspuser}@127.0.0.1 < /tmp/oper_tmp2.sh
echo "Press enter to continue: \c"
read waiting
elif [ "${Answer:="N"}" != "n" -a "${Answer:="N"}" != "N" -a "${Answer:="N"}" != "no" -a "${Answer:="N"}" != "No" ] ; then
echo "!!! Please choose Yes or No !!!"
sleep 1
fi
;;
2)
echo "Are you sure you want to stop Deployment Manager Service on `hostname`? [N/y]: \c"
read Answer
if [ "${Answer:="N"}" = "y" -o "${Answer:="N"}" = "Y" -o "${Answer:="N"}" = "yes" -o "${Answer:="N"}" = "Yes" ] ; then
i=0
> /tmp/oper_tmp2.sh
while (( i < ${#StopDmgr1[*]} ))
do
echo "${StopDmgr1[${i}]}" >> /tmp/oper_tmp2.sh
(( i = i + 1 ))
done
ssh ${webspuser}@127.0.0.1 < /tmp/oper_tmp2.sh
echo "Press enter to continue: \c"
read waiting
elif [ "${Answer:="N"}" != "n" -a "${Answer:="N"}" != "N" -a "${Answer:="N"}" != "no" -a "${Answer:="N"}" != "No" ] ; then
echo "!!! Please choose Yes or No !!!"
sleep 1
fi
;;
3)
echo "Are you sure you want to start Application Server on `hostname`? [N/y]: \c"
read Answer
if [ "${Answer:="N"}" = "y" -o "${Answer:="N"}" = "Y" -o "${Answer:="N"}" = "yes" -o "${Answer:="N"}" = "Yes" ] ; then
i=0
> /tmp/oper_tmp2.sh
while (( i < ${#StartApp1[*]} ))
do
echo "${StartApp1[${i}]}" >> /tmp/oper_tmp2.sh
(( i = i + 1 ))
done
ssh ${webspuser}@127.0.0.1 < /tmp/oper_tmp2.sh
echo "Press enter to continue: \c"
read waiting
elif [ "${Answer:="N"}" != "n" -a "${Answer:="N"}" != "N" -a "${Answer:="N"}" != "no" -a "${Answer:="N"}" != "No" ] ; then
echo "!!! Please choose Yes or No !!!"
sleep 1
fi
;;
4)
echo "Are you sure you want to stop Application Server on `hostname`? [N/y]: \c"
read Answer
if [ "${Answer:="N"}" = "y" -o "${Answer:="N"}" = "Y" -o "${Answer:="N"}" = "yes" -o "${Answer:="N"}" = "Yes" ] ; then
i=0
> /tmp/oper_tmp2.sh
while (( i < ${#StopApp1[*]} ))
do
echo "${StopApp1[${i}]}" >> /tmp/oper_tmp2.sh
(( i = i + 1 ))
done
ssh ${webspuser}@127.0.0.1 < /tmp/oper_tmp2.sh
echo "Press enter to continue: \c"
read waiting
elif [ "${Answer:="N"}" != "n" -a "${Answer:="N"}" != "N" -a "${Answer:="N"}" != "no" -a "${Answer:="N"}" != "No" ] ; then
echo "!!! Please choose Yes or No !!!"
sleep 1
fi
;;
99)
;;
*)
echo "!!!Please select a number from the list!!!"
sleep 1
;;
esac
done
}
#====================================================================
#
# 2.3. HOUSE KEEPING WEBSPHERE MENU FUNCTION : Operator Menu
#
#====================================================================
House_Keeping_WBS_Menu()
{
house_keeping_wbs_menu=0
while [[ ! "x${house_keeping_wbs_menu}x" = "x99x" ]] ; do
clear
echo "==========================================="
echo "|--- Operation Menu (`hostname`) "
echo "|--- 2. Websphere Main Menu "
echo "|--- 2.3 Maintain Log Websphere Menu "
echo "===========================================\n"
echo " (1) View Tail Start Deployment Manager Log File"
echo " (2) View Tail Stop Deployment Manager Log File"
echo " (3) View Tail SystemOut Deployment Manager Log File"
echo " (4) View Tail SystemErr Deployment Manager Log File"
echo "-------------------------------------------"
if [ "$(hostname)" = "servs05" ]; then
echo " (5) View Tail Start AppServer Node1 Server1 Log File"
else
echo " (5) View Tail Start AppServer Node2 Server1 Log File"
fi
if [ "$(hostname)" = "servs05" ]; then
echo " (6) View Tail Stop AppServer Node1 Server1 Log File"
else
echo " (6) View Tail Stop AppServer Node2 Server1 Log File"
fi
if [ "$(hostname)" = "servs05" ]; then
echo " (7) View Tail SystemOut AppServer Node1 Server1 Log File"
else
echo " (7) View Tail SystemOut AppServer Node2 Server1 Log File"
fi
if [ "$(hostname)" = "servs05" ]; then
echo " (8) View Tail SystemErr AppServer Node1 Server1 Log File"
else
echo " (8) View Tail SystemErr AppServer Node2 Server1 Log File"
fi
echo "-------------------------------------------"
if [ "$(hostname)" = "servs05" ]; then
echo " (9) View Tail Start AppServer Node1 Server2 Log File"
else
echo " (9) View Tail Start AppServer Node2 Server2 Log File"
fi
if [ "$(hostname)" = "servs05" ]; then
echo "(10) View Tail Stop AppServer Node1 Server2 Log File"
else
echo "(10) View Tail Stop AppServer Node2 Server2 Log File"
fi
if [ "$(hostname)" = "servs05" ]; then
echo "(11) View Tail SystemOut AppServer Node1 Server2 Log File"
else
echo "(11) View Tail SystemOut AppServer Node2 Server2 Log File"
fi
if [ "$(hostname)" = "servs05" ]; then
echo "(12) View Tail SystemErr AppServer Node1 Server2 Log File"
else
echo "(12) View Tail SystemErr AppServer Node2 Server2 Log File"
fi
echo "-------------------------------------------"
if [ "$(hostname)" = "servs05" ]; then
echo "(13) View Tail Start AppServer Node1 Server3 Log File"
else
echo "(13) View Tail Start AppServer Node2 Server3 Log File"
fi
if [ "$(hostname)" = "servs05" ]; then
echo "(14) View Tail Stop AppServer Node1 Server3 Log File"
else
echo "(14) View Tail Stop AppServer Node2 Server3 Log File"
fi
if [ "$(hostname)" = "servs05" ]; then
echo "(15) View Tail SystemOut AppServer Node1 Server3 Log File"
else
echo "(15) View Tail SystemOut AppServer Node2 Server3 Log File"
fi
if [ "$(hostname)" = "servs05" ]; then
echo "(16) View Tail SystemErr AppServer Node1 Server3 Log File"
else
echo "(16) View Tail SystemErr AppServer Node2 Server3 Log File"
fi
echo "(99) Back\n"
echo "Please select a number from the Maintain Log Webshpere Menu: \c"
read house_keeping_wbs_menu
case "$house_keeping_wbs_menu" in
1)
clear
echo "==========================================="
echo "|--- Operation Menu (`hostname`) "
echo "|--- 2. Websphere Main Menu "
echo "|--- 2.3 Maintain Log Websphere Menu "
echo "|--- 2.3.1 View Tail Start Deployment Manager Log File"
echo "===========================================\n"
tail -n 200 ${StartLogDmgr1} | pg -p "Press Enter to continue: "
echo "===========================================\n"
echo "Press enter to continue: \c"
read Answer
;;
2)
clear
echo "==========================================="
echo "|--- Operation Menu (`hostname`) "
echo "|--- 2. Websphere Main Menu "
echo "|--- 2.3 Maintain Log Websphere Menu "
echo "|--- 2.3.2 View Tail Stop Deployment Manager Log File"
echo "===========================================\n"
tail -n 200 ${StopLogDmgr1} | pg -p "Press Enter to continue: "
echo "===========================================\n"
echo "Press enter to continue: \c"
read Answer
;;
3)
clear
echo "==========================================="
echo "|--- Operation Menu (`hostname`) "
echo "|--- 2. Websphere Main Menu "
echo "|--- 2.3 Maintain Log Websphere Menu "
echo "|--- 2.3.3 View Tail SystemOut Deployment Manager Log File"
echo "===========================================\n"
tail -n 200 ${SystemOutLogDmgr1} | pg -p "Press Enter to continue: "
echo "===========================================\n"
echo "Press enter to continue: \c"
read Answer
;;
4)
clear
echo "==========================================="
echo "|--- Operation Menu (`hostname`) "
echo "|--- 2. Websphere Main Menu "
echo "|--- 2.3 Maintain Log Websphere Menu "
echo "|--- 2.3.4 View Tail SystemErr Deployment Manager Log File"
echo "===========================================\n"
tail -n 200 ${SystemErrLogDmgr1} | pg -p "Press Enter to continue: "
echo "===========================================\n"
echo "Press enter to continue: \c"
read Answer
;;
5)
clear
echo "==========================================="
echo "|--- Operation Menu (`hostname`) "
echo "|--- 2. Websphere Main Menu "
echo "|--- 2.3 Maintain Log Websphere Menu "
if [ "$(hostname)" = "servs05" ]; then
echo "|--- 2.3.5 View Tail Start AppServer Node1 Server1 Log File"
tail -n 200 ${StartLogN1S1} | pg -p "Press Enter to continue: "
else
echo "|--- 2.3.5 View Tail Start AppServer Node2 Server1 Log File"
tail -n 200 ${StartLogN2S1} | pg -p "Press Enter to continue: "
fi
echo "===========================================\n"
echo "Press enter to continue: \c"
read Answer
;;
6)
clear
echo "==========================================="
echo "|--- Operation Menu (`hostname`) "
echo "|--- 2. Websphere Main Menu "
echo "|--- 2.3 Maintain Log Websphere Menu "
if [ "$(hostname)" = "servs05" ]; then
echo "|--- 2.3.6 View Tail Stop AppServer Node1 Server1 Log File"
tail -n 200 ${StopLogN1S1} | pg -p "Press Enter to continue: "
else
echo "|--- 2.3.6 View Tail Start AppServer Node2 Server1 Log File"
tail -n 200 ${StopLogN2S1} | pg -p "Press Enter to continue: "
fi
echo "===========================================\n"
echo "Press enter to continue: \c"
read Answer
;;
7)
clear
echo "==========================================="
echo "|--- Operation Menu (`hostname`) "
echo "|--- 2. Websphere Main Menu "
echo "|--- 2.3 Maintain Log Websphere Menu "
if [ "$(hostname)" = "servs05" ]; then
echo "|--- 2.3.7 View Tail SystemOut AppServer Node1 Server1 Log File"
tail -n 200 ${SystemOutLogN1S1} | pg -p "Press Enter to continue: "
else
echo "|--- 2.3.7 View Tail SystemOut AppServer Node2 Server1 Log File"
tail -n 200 ${SystemOutLogN2S1} | pg -p "Press Enter to continue: "
fi
echo "===========================================\n"
echo "Press enter to continue: \c"
read Answer
;;
8)
clear
echo "==========================================="
echo "|--- Operation Menu (`hostname`) "
echo "|--- 2. Websphere Main Menu "
echo "|--- 2.3 Maintain Log Websphere Menu "
if [ "$(hostname)" = "servs05" ]; then
echo "|--- 2.3.8 View Tail SystemErr AppServer Node1 Server1 Log File"
tail -n 200 ${SystemErrLogN1S1} | pg -p "Press Enter to continue: "
else
echo "|--- 2.3.8 View Tail SystemErr AppServer Node2 Server1 Log File"
tail -n 200 ${SystemErrLogN2S1} | pg -p "Press Enter to continue: "
fi
echo "===========================================\n"
echo "Press enter to continue: \c"
read Answer
;;
9)
clear
echo "==========================================="
echo "|--- Operation Menu (`hostname`) "
echo "|--- 2. Websphere Main Menu "
echo "|--- 2.3 Maintain Log Websphere Menu "
if [ "$(hostname)" = "servs05" ]; then
echo "|--- 2.3.9 View Tail Start AppServer Node1 Server2 Log File"
tail -n 200 ${StartLogN1S2} | pg -p "Press Enter to continue: "
else
echo "|--- 2.3.9 View Tail Start AppServer Node2 Server2 Log File"
tail -n 200 ${StartLogN2S2} | pg -p "Press Enter to continue: "
fi
echo "===========================================\n"
echo "Press enter to continue: \c"
read Answer
;;
10)
clear
echo "==========================================="
echo "|--- Operation Menu (`hostname`) "
echo "|--- 2. Websphere Main Menu "
echo "|--- 2.3 Maintain Log Websphere Menu "
if [ "$(hostname)" = "servs05" ]; then
echo "|--- 2.3.10 View Tail Stop AppServer Node1 Server2 Log File"
tail -n 200 ${StopLogN1S2} | pg -p "Press Enter to continue: "
else
echo "|--- 2.3.10 View Tail Start AppServer Node2 Server2 Log File"
tail -n 200 ${StopLogN2S2} | pg -p "Press Enter to continue: "
fi
echo "===========================================\n"
echo "Press enter to continue: \c"
read Answer
;;
11)
clear
echo "==========================================="
echo "|--- Operation Menu (`hostname`) "
echo "|--- 2. Websphere Main Menu "
echo "|--- 2.3 Maintain Log Websphere Menu "
if [ "$(hostname)" = "servs05" ]; then
echo "|--- 2.3.11 View Tail SystemOut AppServer Node1 Server2 Log File"
tail -n 200 ${SystemOutLogN1S2} | pg -p "Press Enter to continue: "
else
echo "|--- 2.3.11 View Tail SystemOut AppServer Node2 Server2 Log File"
tail -n 200 ${SystemOutLogN2S2} | pg -p "Press Enter to continue: "
fi
echo "===========================================\n"
echo "Press enter to continue: \c"
read Answer
;;
12)
clear
echo "==========================================="
echo "|--- Operation Menu (`hostname`) "
echo "|--- 2. Websphere Main Menu "
echo "|--- 2.3 Maintain Log Websphere Menu "
if [ "$(hostname)" = "servs05" ]; then
echo "|--- 2.3.12 View Tail SystemErr AppServer Node1 Server2 Log File"
tail -n 200 ${SystemErrLogN1S2} | pg -p "Press Enter to continue: "
else
echo "|--- 2.3.12 View Tail SystemErr AppServer Node2 Server2 Log File"
tail -n 200 ${SystemErrLogN2S2} | pg -p "Press Enter to continue: "
fi
echo "===========================================\n"
echo "Press enter to continue: \c"
read Answer
;;
13)
clear
echo "==========================================="
echo "|--- Operation Menu (`hostname`) "
echo "|--- 2. Websphere Main Menu "
echo "|--- 2.3 Maintain Log Websphere Menu "
if [ "$(hostname)" = "servs05" ]; then
echo "|--- 2.3.13 View Tail Start AppServer Node1 Server3 Log File"
tail -n 200 ${StartLogN1S3} | pg -p "Press Enter to continue: "
else
echo "|--- 2.3.13 View Tail Start AppServer Node2 Server3 Log File"
tail -n 200 ${StartLogN2S3} | pg -p "Press Enter to continue: "
fi
echo "===========================================\n"
echo "Press enter to continue: \c"
read Answer
;;
14)
clear
echo "==========================================="
echo "|--- Operation Menu (`hostname`) "
echo "|--- 2. Websphere Main Menu "
echo "|--- 2.3 Maintain Log Websphere Menu "
if [ "$(hostname)" = "servs05" ]; then
echo "|--- 2.3.14 View Tail Stop AppServer Node1 Server3 Log File"
tail -n 200 ${StopLogN1S3} | pg -p "Press Enter to continue: "
else
echo "|--- 2.3.14 View Tail Start AppServer Node2 Server3 Log File"
tail -n 200 ${StopLogN2S3} | pg -p "Press Enter to continue: "
fi
echo "===========================================\n"
echo "Press enter to continue: \c"
read Answer
;;
15)
clear
echo "==========================================="
echo "|--- Operation Menu (`hostname`) "
echo "|--- 2. Websphere Main Menu "
echo "|--- 2.3 Maintain Log Websphere Menu "
if [ "$(hostname)" = "servs05" ]; then
echo "|--- 2.3.15 View Tail SystemOut AppServer Node1 Server3 Log File"
tail -n 200 ${SystemOutLogN1S3} | pg -p "Press Enter to continue: "
else
echo "|--- 2.3.15 View Tail SystemOut AppServer Node2 Server3 Log File"
tail -n 200 ${SystemOutLogN2S3} | pg -p "Press Enter to continue: "
fi
echo "===========================================\n"
echo "Press enter to continue: \c"
read Answer
;;
16)
clear
echo "==========================================="
echo "|--- Operation Menu (`hostname`) "
echo "|--- 2. Websphere Main Menu "
echo "|--- 2.3 Maintain Log Websphere Menu "
if [ "$(hostname)" = "servs05" ]; then
echo "|--- 2.3.16 View Tail SystemErr AppServer Node1 Server3 Log File"
tail -n 200 ${SystemErrLogN1S3} | pg -p "Press Enter to continue: "
else
echo "|--- 2.3.16 View Tail SystemErr AppServer Node2 Server3 Log File"
tail -n 200 ${SystemErrLogN2S3} | pg -p "Press Enter to continue: "
fi
echo "===========================================\n"
echo "Press enter to continue: \c"
read Answer
;;
99)
;;
*)
echo "!!! Please select a number from the list !!!"
sleep 1
;;
esac
done
}
#====================================================================
#
# MAIN PROGRAM: Operator Menu
#
# PURPOSE: Checks for system instances and
# startup/shutdown system instances
#
#====================================================================
operation_menu=0
while [[ ! "x${operation_menu}x" = "x99x" ]] ; do
clear
echo "========================================"
echo "|--- Operation Menu (`hostname`) "
echo "========================================\n"
echo "(1) System Main Menu"
echo "(2) Websphere Main Menu"
echo "(99) Exit\n"
echo "Please select a number from the Operation Menu: \c"
read operation_menu
case ${operation_menu} in
1)
system_menu
;;
2)
websphere_menu
;;
99)
;;
*)
echo "!!! Please select a number from the list !!!"
sleep 1
;;
esac
done
0 comments:
Post a Comment