public static Map getConnectedServers() {
    final Map map = new HashMap(); // KEY:server (String), VALUE:List of active endpoints
    // returns an unmodifiable set
    Map/* <String,Pool> */ poolMap = PoolManager.getAll();
    for (final Object value : poolMap.values()) {
      PoolImpl pi = (PoolImpl) value;
      Map/* <ServerLocationAndMemberId,Endpoint> */ eps = pi.getEndpointMap();
      for (final Object o : eps.entrySet()) {
        Map.Entry entry = (Map.Entry) o;
        ServerLocation loc = ((ServerLocationAndMemberId) entry.getKey()).getServerLocation();
        org.apache.geode.cache.client.internal.Endpoint ep =
            (org.apache.geode.cache.client.internal.Endpoint) entry.getValue();
        String server = loc.getHostName() + "[" + loc.getPort() + "]";
        Integer count = (Integer) map.get(server);
        if (count == null) {
          map.put(server, 1);
        } else {
          map.put(server, count + 1);
        }
      }
    }
    return map;
  }
Returns a map of servers to count of pools connected to that server. The map entry key is a
String representation of the server,

@return map of servers to count of pools using that server
geode-core/src/main/java/org/apache/geode/internal/cache/tier/InternalClientMembership.java