check network connection between servers on a port
I've a requirement to check network connection between servers on a port (any port) and should return the result in the below format along with the response time its successful
Ex: myserver:443 | Success | 3.4s
myserver1:25 | Service not running | 0.2s
Can somebody please help me to achieve this in a bash script if possible. I'm new to Linux administration and got a requirement to work on this all of the sudden.