Commit aa39a5ad by Feanil Patel

Verify NAT health with pings before declaring it healthy.

parent 83b0744a
......@@ -1799,7 +1799,6 @@
" if [ \"$NAT_STATE\" == \"stopped\" ]; then\n",
" echo `date` \"-- NAT($PRIMARY_NAT_ID) instance stopped, starting it back up\"\n",
" /opt/ec2-api-tools/bin/ec2-start-instances $PRIMARY_NAT_ID -U $EC2_URL\n",
" NAT_HEALTHY=1\n",
" sleep $Wait_for_Instance_Start\n",
" else\n",
" if [ \"$STOPPING_NAT\" == \"0\" ]; then\n",
......@@ -1809,10 +1808,14 @@
" fi\n",
" sleep $Wait_for_Instance_Stop\n",
" fi\n",
" unhealthy_nat_pingresult=`ping -c $Num_Pings -W $Ping_Timeout $PRIMARY_NAT_IP| grep time= | wc -l`\n",
" if [ \"$unhealthy_nat_pingresult\" != \"$Num_Pings\" ]; then\n",
" NAT_HEALTHY=1\n",
" fi\n",
" done\n",
"\n",
" # Backup nat was healthy so we switched to it. It is now the primary.\n",
" if [ \"$NAT_HEALTHY\" == \"1\" ]; then\n",
" if [ \"$ROUTE_HEALTHY\" == \"1\" ]; then\n",
" TEMP_NAT_ID=$PRIMARY_NAT_ID\n",
" TEMP_NAT_IP=$PRIMARY_NAT_IP\n",
"\n",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment