I want to connect to 2 machines remotely. For doing that I should first make sure that both the machines are running. One way to do this is by using ping which might not work sometimes because of the firewall. Are there any other methods to check if a particular machine is running even if the firewall is enabled. (In other words, is there any way to check the existence of a machine)
2 Answers
If you don't want to do it using ping, you can do your check by probing the IP:Port
of the relevant service. For example, you can check port 80 of the machine IP if you expect it run a web service.
However, this may also be blocked by a firewall. So, you need to choose the suitable way according to your specific use case. If the firewall you are talking about is under your (or your organization) control, you can open (ask to open) the required protocols and ports.
I want to connect to 2 machines remotely. For doing that I should first make sure that both the machines are running. [...]
Fair enough.
[...] One way to do this is by using ping which might not work sometimes because of the firewall. [...]
No, it is not. You contradict yourself at this point.
[...] Are there any other methods to check if a particular machine is running even if the firewall is enabled. (In other words, is there any way to check the existence of a machine)
Have either machine deposit in a third place a proof of liveness. So you can check the two proofs before connecting to either of the two machines.