Sponsored Content
Top Forums UNIX for Advanced & Expert Users Finding process that turned on ports Post 302750849 by jim mcnamara on Wednesday 2nd of January 2013 03:57:11 PM
Old 01-02-2013
As root
Code:
ptree -a |awk '{print $1}' |xargs  pfiles |egrep '(^[0-9]|SOCK|peername|sockname)'

The output will be like this:

Code:
14432:  /local/banner/prod_envs/banner_prod/general/exe/uapsogn -f -o /local/b
   5: S_IFSOCK mode:0666 dev:371,0 ino:47181 uid:0 gid:0 size:0
        SOCK_STREAM
        sockname: AF_INET 10.128.3.243  port: 35255
        peername: AF_INET 10.128.3.240  port: 1521
14456:  /local/banner/prod_envs/banner_prod/general/exe/uspschs -f -o /local/b
   5: S_IFSOCK mode:0666 dev:371,0 ino:17906 uid:0 gid:0 size:0
        SOCK_STREAM
        sockname: AF_INET 10.128.3.243  port: 35257        peername: AF_INET 10.128.3.240  port: 1521
14490:  /local/banner/prod_envs/banner_prod/general/exe/uzpsocl -f -o /local/b
   5: S_IFSOCK mode:0666 dev:371,0 ino:226 uid:0 gid:0 size:0
        SOCK_STREAM
        sockname: AF_INET 10.128.3.243  port: 35259
        peername: AF_INET 10.128.3.240  port: 1521
14514:  /local/banner/prod_envs/banner_prod/general/exe/uzpsopr -f -o /local/b
   5: S_IFSOCK mode:0666 dev:371,0 ino:5441 uid:0 gid:0 size:0
        SOCK_STREAM
        sockname: AF_INET 10.128.3.243  port: 35262
        peername: AF_INET 10.128.3.240  port: 1521

The sockets are red
the pids you want are green
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

finding process id

is there a way to find the process id of a process because i have same process invoked several times. when i need to kill them, i get confused with the id. Thanks, sskb :( (8 Replies)
Discussion started by: sskb
8 Replies

2. UNIX for Dummies Questions & Answers

unix process that frees ports

Hello, I know that there is a unix system process that checks periodically the ports and if it finds any zombies then it frees them (the period is set by a kernel parameter). Can anyone tell me the name of the process and the kernel parameter ? Thanks :) (2 Replies)
Discussion started by: FunnyCats
2 Replies

3. UNIX for Dummies Questions & Answers

Finding out process id in a scipt

Hi, If in a shell script i write a command ls > bla & ls The output is redirected to bla and the next ls starts as first one is going on in background. I want to find the PID of the first command. Thanks in advance (2 Replies)
Discussion started by: vibhor_agarwali
2 Replies

4. Solaris

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: root@xxx:~# netstat -anp | grep LISTEN tcp 0 0 0.0.0.0:7937 0.0.0.0:* LISTEN 16082/nsrexecd tcp 0 ... (7 Replies)
Discussion started by: vimes
7 Replies

5. Linux

Need help in finding process

Hello, Iam running a apache webserver in CentOS recenlty a hacker has attacked my server using RFI attack and did something in my server.. After that everyday at 8Pm my httpd is using about 5000 pid's actually in normal it takes only about 30 - 40 pid's. and also exim uses 2000 pid's totally my... (2 Replies)
Discussion started by: dheeraj4uuu
2 Replies

6. Red Hat

No process ID for listening ports

How can I have ports that are listening without processes being associated with them? root@ldv002 # netstat -ltnup Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0... (2 Replies)
Discussion started by: Padow
2 Replies

7. Shell Programming and Scripting

Finding the process id of the process using the ports

Hi Any idea how to get the process id of the process using the ports lsof -i :portnumber does not work in my machine. I am on sun Solaris SPARC. Any suggestion is highly appreciated (1 Reply)
Discussion started by: kinny
1 Replies

8. UNIX for Advanced & Expert Users

Finding process id of subsequent process

hi all, I am trying to find the process id of the subsequent process created via fork and exec calls in perl. For eg: envVarSetter dataCruncher.exe < input.txt > output.txt When I fork and exec the above command, it returns only the pid of envVarSetter and I don't know how to find the... (9 Replies)
Discussion started by: matrixmadhan
9 Replies

9. Shell Programming and Scripting

Finding process which ended another process

Hello, The scenario is as follows, I have a background process running initially for which i know the PID on machine1. I use ssh from machine 2 to execute a script in machine 1. For some reason the back ground process is terminated. I would like to know which process caused the... (6 Replies)
Discussion started by: prasbala
6 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
Apache::TestHandler(3)					User Contributed Perl Documentation				    Apache::TestHandler(3)

NAME
Apache::TestHandler - a few response handlers and helpers SYNOPSIS
package My::Test; use Apache::TestHandler (); sub handler { my ($r) = @_; my $result = do_my_test; Apache::TestHandler::ok1 $r, $result; } sub handler2 { my ($r) = @_; my $result = do_my_test; Apache::TestHandler::ok $r, $result; } DESCRIPTION
"Apache::TestHandler" provides 2 very simple response handler. FUNCTIONS
ok $r, $boolean The handler simply prints out "ok" or "not ok" depending on the optional $boolean parameter. If $boolean is omitted "true" is assumed. ok1 $r, $boolean This handler implements a simple response-only test. It can be used on its own to check if for a certain URI the response phase is reached. Or it can be called like a normal function to print out the test result. The client side is automatically created as described in <http://perl.apache.org/docs/general/testing/testing.html#Developing_Response_only_Part_of_a_Test>. $boolean is optional. If omitted "true" is assumed. same_interp_counter same_interp_fixup TODO SEE ALSO
The Apache-Test tutorial: <http://perl.apache.org/docs/general/testing/testing.html>. Apache::Test. AUTHOR
Doug MacEachern, Geoffrey Young, Stas Bekman, Torsten Foertsch and others. Questions can be asked at the test-dev <at> httpd.apache.org list For more information see: http://httpd.apache.org/test/. perl v5.16.2 2011-04-19 Apache::TestHandler(3)
All times are GMT -4. The time now is 02:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy