I want to check connectivity between 2 servers (i.e. if ssh will succeed).
The main idea is to check the shortest way between server-a and server-b using a list of middle servers (for example if I'm on dev server and I want to connect to prod server - usually a direct ssh will fail).
Because this can take a while, I prefer not to use SSH - rather I prefer to check first if I can connect and if so then try to connect through SSH.
Some possible routes to get the idea:
server-a -> server-b server-a -> middle-server-1 -> server-b server-a -> middle-server-6 -> server-b server-a -> middle-server-3 -> middle-server-2 -> server-b
Hope you understand what I'm looking for?