Sponsored Content
Full Discussion: List TCP ports with process
Operating Systems Solaris List TCP ports with process Post 302252708 by vimes on Thursday 30th of October 2008 06:59:07 AM
Old 10-30-2008
List TCP ports with process

Hello,

One of our developers is asking for a command/script in Solaris similar to "netstat -anp" in Linux. He gave this output as an example:

Code:
root@xxx:~# netstat -anp | grep LISTEN
tcp        0      0 0.0.0.0:7937            0.0.0.0:*               LISTEN     16082/nsrexecd
tcp        0      0 0.0.0.0:7938            0.0.0.0:*               LISTEN     16082/nsrexecd
tcp        0      0 0.0.0.0:7940            0.0.0.0:*               LISTEN     16082/nsrexecd
tcp        0      0 0.0.0.0:7941            0.0.0.0:*               LISTEN     16082/nsrexecd
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN     4257/mysqld
tcp        0      0 127.0.0.1:5432          0.0.0.0:*               LISTEN     4331/postgres
tcp6       0      0 :::80                   :::*                    LISTEN     4403/apache2
tcp6       0      0 :::22                   :::*                    LISTEN     4163/sshd

Note, the command needs to be used on a Solaris 9 machine (no dtrace). I've been playing around with pfiles for an hour or so now and haven't come up with anything that seems 100% correct.

So I was wondering if you guys have any ideas on how to do this. I don't need a ready-made script (unless you have it), just some pointers to how I can produce a similar output.

Thanks. Smilie
 

10 More Discussions You Might Find Interesting

1. IP Networking

TCP Ports

We are being setup with a client over their VPN to support them remotely. We are unable to access their VPN through our server, they said to look and make sure that the TCP ports are enabled for their security setup (ports are in the 4000 range). How do you look for this and how do you enable a... (3 Replies)
Discussion started by: blacksheep
3 Replies

2. UNIX for Dummies Questions & Answers

TCP Listening Ports

Hello all, Can someone instruct me on how to change the listening port for ftp ( or any tcp service) from 21 to another port number? Thanks in advance.. -AJ (3 Replies)
Discussion started by: jacobsa
3 Replies

3. UNIX for Dummies Questions & Answers

TCP/UDP Ports

Just starting to work with unix, wondering if there is any good on-line documentation explaining TCP/UDP ports, how to use them, etc... Thanks.... (1 Reply)
Discussion started by: eugene_mayo
1 Replies

4. IP Networking

TCP/UDP Ports

Just wondering if anyone knows of any good on-line documentation on TCP/UDP Ports. Basically i want to know how to check if they are in use, learn how to close them, etc... Thanks... (5 Replies)
Discussion started by: eugene_mayo
5 Replies

5. UNIX for Advanced & Expert Users

TCP ports - TIME_WAIT

What is the maximum number of TCP ports that can be consumed at any one time? How can I determine what the number is or increase it? I was under the impression that with our system (UnixWare 7.1.1) 1024 was the maximum under our current Kernel tuning parms, but I think that is really just... (4 Replies)
Discussion started by: dlkox
4 Replies

6. Windows & DOS: Issues & Discussions

TCP ports and file sharing

In using a music file sharing program (WinMx), I am told that I cannot make a primary connection (fastest downloads) because I do not have a TCP and UDP port. I am running Windows Me.What do I do? Thanks. (6 Replies)
Discussion started by: dookster5
6 Replies

7. UNIX for Advanced & Expert Users

TCP slow access though certain ports

hi, I'm currently running with an issue whereby we are experiencing very poor access speeds to our Informix database. Connections or requests to the DB are taking in excess of 2/3/4 minutes during peek periods during the day. This has only just started to happen but so far we have been unable to... (0 Replies)
Discussion started by: fastyan
0 Replies

8. UNIX for Dummies Questions & Answers

Opening TCP ports

I'm not sure if this is the right place for this post, but I'd be grateful if somebody could please help me. I'm trying to open ports 999, 1982 and 1983 but am not having much luck. I used iptables -A INPUT -i eth0 -p tcp --sport 999 -m state --state NEW,ESTABLISHED -j ACCEPT iptables -A INPUT -i... (2 Replies)
Discussion started by: thehaapyappy
2 Replies

9. UNIX for Advanced & Expert Users

How to list process connected to tcp port?

Hey guys, I need to kill the process that is currently connected to port 10540. I'm on HP-UX machine. Below is the result of my netstat. $ netstat -an |grep 10540 tcp 0 0 129.0.0.1.10540 *.* LISTEN We don't have lsof command, but we have fuser. ... (3 Replies)
Discussion started by: brichigo
3 Replies

10. UNIX for Dummies Questions & Answers

How do i list running process with the ports they are using?

How do i list the running process and also view the ports they are listening to at the same time? (3 Replies)
Discussion started by: mena
3 Replies
UPSD.CONF(5)							    NUT Manual							      UPSD.CONF(5)

NAME
upsd.conf - Configuration for Network UPS Tools upsd DESCRIPTION
upsd uses this file to control access to the server and set some other miscellaneous configuration values. This file contains details on access controls, so keep it secure. Ideally, only the upsd process should be able to read it. CONFIGURATION DIRECTIVES
"MAXAGE seconds" upsd usually allows a driver to stop responding for up to 15 seconds before declaring the data "stale". If your driver takes a very long time to process updates but is otherwise operational, you can use MAXAGE to make upsd wait longer. Most users should leave this at the default value. "STATEPATH path" Tell upsd to look for the driver state sockets in path rather than the default that was compiled into the program. "LISTEN interface port" Bind a listening port to the interface specified by its Internet address. This may be useful on hosts with multiple interfaces. You should not rely exclusively on this for security, as it can be subverted on many systems. Listen on TCP port port instead of the default value which was compiled into the code. This overrides any value you may have set with configure --with-port. If you don't change it with configure or this value, upsd will listen on port 3493 for this interface. Multiple LISTEN addresses may be specified. The default is to bind to 127.0.0.1 if no LISTEN addresses are specified (and ::1 if IPv6 support is compiled in). LISTEN 127.0.0.1 LISTEN 192.168.50.1 LISTEN ::1 LISTEN 2001:0db8:1234:08d3:1319:8a2e:0370:7344 This parameter will only be read at startup. You'll need to restart (rather than reload) upsd to apply any changes made here. "MAXCONN connections" This defaults to maximum number allowed on your system. Each UPS, each LISTEN address and each client count as one connection. If the server runs out of connections, it will no longer accept new incoming client connections. Only set this if you know exactly what you're doing. "CERTFILE certificate file" When compiled with SSL support, you can enter the certificate file here. The certificates must be in PEM format and must be sorted starting with the subject's certificate (server certificate), followed by intermediate CA certificates (if applicable_ and the highest level (root) CA. It should end with the server key. See docs/security.txt or the Security chapter of NUT user manual for more information on the SSL support in NUT. SEE ALSO
upsd(8), nutupsdrv(8), upsd.users(5) INTERNET RESOURCES
The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ Network UPS Tools 05/21/2012 UPSD.CONF(5)
All times are GMT -4. The time now is 11:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy