LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-03-2014, 02:14 PM   #1
rug.roya
LQ Newbie
 
Registered: Jun 2014
Posts: 3

Rep: Reputation: Disabled
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.
 
Old 06-03-2014, 02:27 PM   #2
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,094

Rep: Reputation: 1515Reputation: 1515Reputation: 1515Reputation: 1515Reputation: 1515Reputation: 1515Reputation: 1515Reputation: 1515Reputation: 1515Reputation: 1515Reputation: 1515
You could use nmap.. is the format that important?

Code:
nmap -sS -p 80 google.com
 
Old 06-03-2014, 02:41 PM   #3
rug.roya
LQ Newbie
 
Registered: Jun 2014
Posts: 3

Original Poster
Rep: Reputation: Disabled
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
 
Old 06-04-2014, 06:59 AM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,254

Rep: Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328
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.

Last edited by chrism01; 06-04-2014 at 07:03 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
bash script that checks network connection between servers rug.roya LinuxQuestions.org Member Success Stories 1 06-03-2014 02:24 PM
How to check utorrent port on remote network? sieuvocmaytinh Linux - Networking 2 09-05-2012 10:16 PM
[SOLVED] Check network connection is Ok sureshpanchanathan Linux - Newbie 6 02-10-2012 01:31 AM
How to check the network port number? sceadu Linux - Networking 2 11-15-2004 11:05 PM
Network connection between two servers? /etc/girl Linux - Networking 6 11-01-2003 09:42 AM


All times are GMT -5. The time now is 07:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration