#status: 0,http down 1,http ok 2,http down but ping ok
if nc -vv -z -w 2 $server_ip $server_port > /dev/null 2>&1;then
status=1
else
if nc -vv -z -w 3 $server_ip $server_port > /dev/null 2>&1;then
status=1
else
if ping -c 1 $server_ip > /dev/null 2>&1;then
status=2
else
status=0
fi
fi
fi
if [ x$status != x"1" ];then
PID=`function_getPID ${server_name}`
if [ x$PID != x ];then
function_jstackinfo ${server_name}
function_restart ${server_name}
else
function_startup ${server_name}
fi
fi
done