- 论坛徽章:
- 0
|
现在是想在while循环里第三次时,且CHECK 状态是jmxportok话,就退出第一条for循环,执行第二条for 循环。如果在规定的次数内获取状态异常,则报警并退出;如果没有问题的话,就按正常的流程走。
function get_appinfo()
{
IFS=$'\n';
for info in $(cat /opt/oracle/sor/deploy/batch/Operate_temp/TMP_two_command.xn5452 |grep -v ^#);
do
let i++;
app_ip=`echo $info | awk -F ";" '{print $2}' |awk '{print $3}'`;
instance_name=`echo $info | awk -F ";" '{print $2}' |awk '{print $4}'`;
echo "ip=${app_ip} instance=${instance_name}";
#check deploy result loop
local Check_Two_Node_Deploy_result_Count=0
while [ ${Check_Two_Node_Deploy_result_Count} -lt ${Sleep_Index} ]
do
sleep ${Sleep_Duration}
Get_Jmx_status ${app_ip} ${instance_name}
if [[ $i%2 -eq 1 ]]
then
node_jmx_port_status1=${node_jmx_port_status};
elif [[ $i%2 -eq 0 ]]
then
node_jmx_port_status2=${node_jmx_port_status};
fi
if [[ ${node_jmx_port_status1} == "jmxportok" ]] && [[ ${Check_Two_Node_Deploy_result_Count} == "2" ]]
then
echo "1111111Update_Node_Tmp_Deploy_Command ${app_ip} ${instance_name} ${app_name} ${instance_path} ${warpath_type}"
break
elif [[ ${node_jmx_port_status2} == "jmxportok" ]] && [[ ${Check_Two_Node_Deploy_result_Count} == "2" ]]
then
echo "${app_ip} ${instance_name} ${app_ip} ${instance_name} all ok"
echo "22221Update_Node_Tmp_Deploy_Command ${app_ip} ${instance_name} ${app_name} ${instance_path} ${warpath_type}"
sleep 2
echo "Batch_Node_Deploy"
exit
else
echo "${app_ip} ${instance_name} ${app_ip} ${instance_name} not all ok"
fi
((Check_Two_Node_Deploy_result_Count++));
done
if [[ ${Check_Two_Node_Deploy_result_Count} -eq ${Sleep_Index} ]]
then
echo "Check_Send ${Check_One_Node_Deploy_result_Count} ${app_ip} ${instance_name} "
exit
fi
done
}
|
|