With a list of servers, it is common that one or more are down or crash. Lots cluster management tools can detect the aliveness of servers. However, it can be easily done with
ping with a Bash script.
I summarize the script that I used and share it here:
This produces "0" if the server can not be reached by
ping (very possibly down).