Script for port is open or not

 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Script for port is open or not
# 1  
Old 06-25-2018
Script for port is open or not

I need a script on which if i will pass the port number and the host name as external parameter then it should respond me if the port is open or not

Moderator's Comments:
Mod Comment thread moved

Last edited by jim mcnamara; 06-25-2018 at 10:27 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Solaris

Solaris 10: How to just open a port - nothing else

Hi there, I tried just open a port but I failed ;-( # telnet localhost 9876 That should work so I did ... # vi /etc/services myport 9876/tcp # my port # svcadm restart inetd -> New pid, see ps - ef | grep inet # netstat -an | grep 9876 No port 9876 is waiting ;( #... (4 Replies)
Discussion started by: System
4 Replies

2. HP-UX

How to open 443 port in HP-UX?

Hello Experts, I want to open the port 443 on my HP-UX system. can you please help ? Thanks in advance. (1 Reply)
Discussion started by: purushottamaher
1 Replies

3. IP Networking

Tcp ip port open but no such process (merged: Release A Port)

i want to kill a tcp connection by killing its pid with netstat -an i got the tcp ip connection on port 5914 but when i type ps -a or ps-e there is not such process running on port 5914 is it possible that because i do not log on with proper user account i can not see that process running? (30 Replies)
Discussion started by: alinamadchian
30 Replies

4. Red Hat

[help]Open port Centos

I uses iptables but not working :mad: (2 Replies)
Discussion started by: lup
2 Replies

5. Red Hat

Open port with iptables

Hi, What iptables command do I need to run in order to open up the following port for incomming traffic on the following server: # telnet 127.0.0.1 1521 Trying 127.0.0.1... telnet: connect to address 127.0.0.1: Connection refused telnet: Unable to connect to remote host: Connection... (3 Replies)
Discussion started by: Duffs22
3 Replies

6. IP Networking

Unknown open port: "6881/tcp open bittorrent-tracker" found with nmap

Hi. I ran nmap on my server, and I get the following: Starting Nmap 4.76 ( http://nmap.org ) at 2009-03-19 16:33 EDT Interesting ports on -------- (-----): Not shown: 997 closed ports PORT STATE SERVICE 22/tcp open ssh 80/tcp open http 6881/tcp open bittorrent-tracker The... (0 Replies)
Discussion started by: Rledley
0 Replies

7. AIX

How to open a port in AIX

Hi Guys, i am trying to open a port in AIX. but i am not able to get the command for this. AIX is not having the iptables file present. So please any body can tell me how to open a port in AIX... Thanks sanju (2 Replies)
Discussion started by: sanju_d1231
2 Replies

8. Linux

open port

How can I open a port on linux machine ??? (5 Replies)
Discussion started by: mm00123
5 Replies

9. Solaris

Solaris 8 to many open port

hi all, My OS is solaris 8 with core system installation only. so far everything works fine. by i do some testing from my xp pc as client to nmap and scan opening port to my solaris. the result as below: Initiating SYN Stealth Scan against 10.10.10.10 at 16:25 Discovered open port 21/tcp on... (3 Replies)
Discussion started by: hezry79
3 Replies
Login or Register to Ask a Question
rpc_name_to_sockaddr(3ncs)												rpc_name_to_sockaddr(3ncs)

Name
       rpc_name_to_sockaddr - convert a host name and port number to a socket address (client or server)

Syntax
       #include <idl/c/rpc.h>

       void rpc_$name_to_sockaddr(name, nlength, port, family, sockaddr,				slength, status)
       unsigned char name;
       unsigned long nlength;
       unsigned long port;
       unsigned long family;
       socket_$addr_t *sockaddr;
       unsigned long *slength;
       status_$t *status;

Arguments
       name		   A  string  that  contains  a host name and, optionally, a port and an address family.  The format is family:host[port],
			   where family: and [port] are optional.  If you specify a family as  part  of  the  name  parameter,	you  must  specify
			   socket_$unspec in the family parameter.  The family part of the name parameter is ip; host is the host name; port is an
			   integer port number.

       nlength		   The number of characters in name.

       port		   The socket port number.  This parameter should have the value rpc_$unbound_port if you are not specifying a	well-known
			   port;  in  this case, the returned socket address will specify the Local Location Broker (LLB) forwarding port at host.
			   If you specify the port number in the name parameter, this parameter is ignored.

       family		   The address family to use for the socket address.  This value corresponds to the communications protocol used to access
			   the socket and determines how the sockaddr is expressed.  If you specify the address family in the name parameter, this
			   parameter must have the value socket_$unspec.

       sockaddr 	   The socket address corresponding to name, port, and family.

       slength		   The length, in bytes, of sockaddr.

       status		   The completion status.  If the completion status returned in is equal to status_$ok , then the routine that supplied it
			   was successful.

Description
       The routine provides the socket address for a socket, given the host name, the port number, and the address family.

       You  can specify the socket address information either as one text string in the name parameter or by passing each of the three elements as
       separate parameters( name, port, and family ); in the latter case, the name parameter should contain only the hostname.

Diagnostics
       This section lists status codes for errors returned by this routine in

       rpc_$not_in_call    An internal error.

       rpc_$proto_error    An internal protocol error.	This routine has been superseded by the routine.

Files
See Also
       intro(3ncs), rpc_sockaddr_to_name(3ncs), socket_from_name(3ncs)

															rpc_name_to_sockaddr(3ncs)