How to grep PID and program name from netstat in AIX?


 
Thread Tools Search this Thread
Operating Systems AIX How to grep PID and program name from netstat in AIX?
# 1  
Old 02-02-2015
How to grep PID and program name from netstat in AIX?

Hi All,

I am using netstat on AIX to grep info on all open connections. However, unlike on Linux(Centos), I do not get the PID and program name using netstat on AIX.
I need this info to be clubbed along with the information retrieved using netstat version of AIX. Is there a way this can be accomplished in AIX?



# 2  
Old 02-02-2015
You will need to use a tool like lsof to see which processes have the port open.

You can get lsof by searching openly on the internet.


The command will be something like:-
Code:
lsof -i tcp:port

...where you insert or loop round the ports you need. There may be quite a bit of output but enough to trace back the PID and therefore the command.


Robin
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. HP-UX

PID and program name from netstat.

Hello All, I am using netstat on HP-UX to retrieve the established network connections on my host. Can anyone please confirm how can I retrieve the PID and program name as well for these connections? These are available from the netstat version on Windows but I don't see PID and program name to... (10 Replies)
Discussion started by: Happy83
10 Replies

2. Shell Programming and Scripting

netstat grep regex suspend script help

Hi I am trying to create a suspend script which will suspend the system only if it cant find port 9982 four or more times OR 192.168.0.:microsoft-ds ESTABLISHED in the output of netstat -t. I am struggling with the 9982 bit, googling etc I came up with if netstat -t|grep -P "(9982){4,}" ... (15 Replies)
Discussion started by: bilboNIX
15 Replies

3. Shell Programming and Scripting

How set filter netstat -an | grep -P '\:'38''

Hi, I can write sh script for Linux platform I run: netstat -an | grep -P '\:'38''| grep ESTABLISHED but result: # netstat -an | grep -P '\:'38''| grep ESTABLISHED tcp 0 0 172.16.1.107:383 172.16.1.81:49981 ESTABLISHED tcp 0 0... (8 Replies)
Discussion started by: ostapv
8 Replies

4. Programming

getting the pid of another C program with unix calls

I have a C program called server.c which is supposed to get the pid of another program, client.c, and send a signal to it, but I'm not sure how to do it. Server.c is first run in the background then client is run in the foreground. I tried pid_t pid; pid = system("pidof -s client.c");... (3 Replies)
Discussion started by: busdude
3 Replies

5. AIX

AIX PID Recycling

Had a bizzare problem last night with one of our tools running on an AIX server that has not come up before. The tool has been in use for over a year without this problem showing up.The tool basically does this: -Kick off a background task and record the PIDGo and do a bunch of other taskswait for... (4 Replies)
Discussion started by: steadyonabix
4 Replies

6. UNIX for Advanced & Expert Users

Aix pid issue

Hi I have an IBM AIX 5.3 64Bit running with 64bit application (Kernel runs on 64bit also). I changed the maximum proccesses per user to the maximum. Currently the pids of proccesses in the system using 5 digits (<100000). Is it possible to make the system use pids bigger then 4500000? I need it... (6 Replies)
Discussion started by: idana
6 Replies

7. AIX

AIX: PID 0 Process

Hi All, I searched other threads and could not find any relevant post about this. I searched for process 0 in SUN OS and could find the sched/swapper process listed. root 0 0 0 Apr 25 ? 0:06 sched but i couldnt not find the swapper process (PID 0) in AIX. Is that... (4 Replies)
Discussion started by: quintet
4 Replies

8. UNIX for Advanced & Expert Users

netstat -p, missing PID/program name

I have a netstat command set up with awk to show which ports my box is listening on. The -p switch shows the PID/program name, too, which ordinarily would be very handy. However, several entries show up as just "-" for the program name which makes it hard to identify what is keeping the port open.... (2 Replies)
Discussion started by: Bilge
2 Replies

9. UNIX for Dummies Questions & Answers

pid from port number in AIX

Hello guys, How to shut down a port number in AIX. May be first I need to find out what is the process ID of that process that listens to this particular port.. Is there any command to find a process ID from the port number other than "lsof". thanks (1 Reply)
Discussion started by: solaix14
1 Replies

10. UNIX for Dummies Questions & Answers

need help on netstat -na |grep

Hi, I use the following cmd to view list of clients connected to my HPUX server netstat -na |grep Can anyone help me with the UNIX cmds to find list of clients connected to my HPUX server including idle time. Any help will be highly appreciated. Thanks MH (2 Replies)
Discussion started by: mhbd
2 Replies
Login or Register to Ask a Question