Code to check if hosts are reachable or not from a given list of hosts