LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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, 01: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, 01:27 PM   #2
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

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

Code:
nmap -sS -p 80 google.com
 
Old 06-03-2014, 01: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, 05:59 AM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
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 06:03 AM.
 
  


Reply



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 01:24 PM
How to check utorrent port on remote network? sieuvocmaytinh Linux - Networking 2 09-05-2012 09:16 PM
[SOLVED] Check network connection is Ok sureshpanchanathan Linux - Newbie 6 02-10-2012 12:31 AM
How to check the network port number? sceadu Linux - Networking 2 11-15-2004 10:05 PM
Network connection between two servers? /etc/girl Linux - Networking 6 11-01-2003 08:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:07 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
Open Source Consulting | Domain Registration