How to check internet connection from Greenplum Cluster
Here is a simple function to check the connectivity between greenplum cluster and external IP.
function check_connection()
{
curl google.com 2>&1 | grep -i "curl.*resolve host" > /dev/null 2>&1
if [[ $? == 0 ]]; then
echo "disconnected"
else
echo "connected"
fi
}
function check_ext_connection()
{
ping -c 1 google.com > /dev/null 2>&1
if [[ $? == 0 ]]; then
CONNECTION=true
fi
return
}
Comments
Post a Comment