check network connection between servers on a port
Hi,
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. |
You could use nmap.. is the format that important?
Code:
nmap -sS -p 80 google.com |
Thanks a lot for your quick reply.
Format is not important, but looking for to capture possible reasons for fail and response time. Thanks for the support |
Try this http://linux.die.net/man/1/echoping for timings.
Its a little difficult to automate 'reasons for failure' without writing a script. I also highly recommend you bookmark/read this http://rute.2038bug.com/index.html.gz You should also look into ping, tcptraceroute etc. There are many tools for measuring network performance and checking if something is listening eg telnet client is good for quick n dirty checks. See www.linuxtopia.org for free to read manuals. |
All times are GMT -5. The time now is 03:41 AM. |