Unix/Linux Go Back    

UNIX for Dummies Questions & Answers This forum is closed for new posts. Please post beginner questions to learn unix and learn linux in this forum UNIX for Beginners Questions & Answers

Test Connection to hosts

UNIX for Dummies Questions & Answers

Thread Tools Search this Thread Display Modes
Old Unix and Linux 10-06-2012
SkySmart SkySmart is offline
Registered User
Join Date: Dec 2006
Last Activity: 21 October 2017, 2:04 AM EDT
Posts: 892
Thanks: 730
Thanked 3 Times in 3 Posts
Test Connection to hosts

i have about 3500 hosts/devices which i monitor.

i monitor them from one host. we'll call this one host HOSTA. HOSTA has connectivity to all 3500 hosts/devices.

now, i have to create a backup for HOSTA. and the back up is in another state.

how do i get a list of all open ports on HOSTA so I can have them replicated on HOSTB?

please keep in mind, i wont be the one making the actual change. i just need to have the information ready to give to the necessary personnel that will be setting it up.

so the options i have in mind are:

nmap OR
netcat (nc)

how can i use either of these two commands to get all open ports that HOSTA can connect to on all 3500 hosts/devices?

for example:

lets say one of the 3500 hosts/devices i monitor is called merchant-01.skysmart.net

i'm hoping there will be a command similar to this:

nmap HOSTA merchant-01.skysmart.net

what i'll be expecting the aforementioned command to do is get me a list of ALL OPEN ports that HOSTA can connect to on merchant-01.skysmart.net. when i say all, i mean all. udp, tcp, whichever.

any ideas?

os: Linux Red Hat/SunOS
Sponsored Links
Old Unix and Linux 10-07-2012
bakunin bakunin is offline Forum Staff  
Bughunter Extraordinaire
Join Date: May 2005
Last Activity: 21 October 2017, 2:19 AM EDT
Location: In the leftmost byte of /dev/kmem
Posts: 5,612
Thanks: 106
Thanked 1,598 Times in 1,176 Posts
I don't understand what exactly you are after. Knowing a list of open ports will help you not at all in getting what you said you want and you can't "copy" this in any way.

If you want to guarantee simple IP connectivity the new host just has to be in the same subnet than the old one. That is: HOSTB has to share the IP subnet with HOSTA. Then it is copying the routing information of HOSTA (issue "netstat -rn" to get this information) and you should be done.

Further complications would arise if there are firewalls within your network: You will have to adapt their rules, but this can only be done on the firewall systems themselves, neither on HOSTA nor HOSTB.

If you need a certain protocol to work you will have to make sure all the prerequisites are met. For instance, if you want "ssh" to work (probably without further authentification) you will have to make sure the "sshd" configuration is in place ("/etc/sshd_config") and the keys are exchanged (as per default "~/.ssh/authorized_keys", "~/.ssh/known_hosts"). Still, you won't need any list of open ports for this.

Of course you could use "nmap" consecutively on all your hosts to find out open ports, but it would be probably easier to use "netstat" locally on each of them , as you claim to have HOSTA having connectivity to all of them (whatever this means - pingable? exchanged ssh-keys? something else?). Still, what will that information help you? Definitely not in building HOSTB, because there is nothing you could configure in HOSTB based on this information.

I hope this helps.


Last edited by bakunin; 10-07-2012 at 04:11 AM..
Sponsored Links

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
bash script to test network connection - please help shadow_boi Shell Programming and Scripting 2 09-21-2009 03:25 AM
Need help to make connection to various hosts anjum.suri Shell Programming and Scripting 3 09-04-2009 10:58 AM
Connection Test Script princeboot Shell Programming and Scripting 1 08-19-2009 03:44 PM
Database Connection test in unix Script ali560045 Shell Programming and Scripting 3 06-30-2009 09:31 AM
How to Create a shell script to test the telnet connection status yhcheong Shell Programming and Scripting 16 03-19-2009 11:33 AM

All times are GMT -4. The time now is 04:23 AM.