LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Red Hat (https://www.linuxquestions.org/questions/red-hat-31/)
-   -   PS/NETSTAT/LSOF AARGH!! Please Help Me (https://www.linuxquestions.org/questions/red-hat-31/ps-netstat-lsof-aargh-please-help-me-849325/)

x81kilo 12-09-2010 12:44 PM

PS/NETSTAT/LSOF AARGH!! Please Help Me
 
Hey everyone, I have a problem, where I work, we have VM's (ok thats not the problem yet!) anyhow, we have apache tomcat and jboss on the vm's right and they are housed in

/opt/ibm/jboss, apache-tomcat etc. our problem is that we get 10gb sized vm's and then we can request NFS/SAN mounted space as needed to increase size based on project.

We are currently running out of amount of VMs we can request for new projects and have been requested to run multiple instances of Jboss and Apache Tomcat on the existing servers.

My problem is, that apache runs the apache server process as 'APACHE' as seen below.

How can i go about finding which apache process belongs to which apache instance?

** multiple virtual ip's running on each box **

so i have
/opt/ibm/proj1/apache or jboss
/opt/ibm/proj2/apache or jboss
/opt/ibm/proj3/apache or jboss

each has a different ip address assigned to each project all are running on standard port 80 and 8080 (for jboss)

if I run ps or netstat or lsof (example below) It doesnt tell me from which of these proj1-3 folders the process is running from. the major problem is multiple people are working on multiple vm's so a lot of toe stepping and killing my processes inadvertently is happening. Is there an awesome linux way to figure this out?
lsof | grep "LISTEN"
portmap 1193 rpc 4u IPv4 2974 TCP *:sunrpc (LISTEN)
rpc.statd 1227 root 7u IPv4 3147 TCP *:985 (LISTEN)
ypbind 1388 root 5u IPv4 3788 TCP *:721 (LISTEN)
snmpd 1434 root 9u IPv4 4239 TCP localhost:smux (LISTEN)
sshd 1464 root 3u IPv6 3988 TCP *:ssh (LISTEN)
nsrexecd 1520 root 5u IPv4 4174 TCP *:7938 (LISTEN)
nsrexecd 1520 root 6u IPv4 4175 TCP *:8795 (LISTEN)
nsrexecd 1520 root 7u IPv4 4181 TCP *:8029 (LISTEN)
nsrexecd 1520 root 8u IPv4 4190 TCP *:7937 (LISTEN)
httpd 13795 root 4u IPv6 577098 TCP *:http (LISTEN)
httpd 13795 root 6u IPv6 577103 TCP *:https (LISTEN)
java 21707 root 45u IPv6 14702487 TCP *:webcache (LISTEN)
java 21707 root 57u IPv6 14702491 TCP *:8009 (LISTEN)
java 21707 root 59u IPv6 14702493 TCP localhost:8005 (LISTEN)
httpd 23440 apache 4u IPv6 577098 TCP *:http (LISTEN)
httpd 23440 apache 6u IPv6 577103 TCP *:https (LISTEN)
httpd 23441 apache 4u IPv6 577098 TCP *:http (LISTEN)
httpd 23441 apache 6u IPv6 577103 TCP *:https (LISTEN)
httpd 23442 apache 4u IPv6 577098 TCP *:http (LISTEN)
httpd 23442 apache 6u IPv6 577103 TCP *:https (LISTEN)
httpd 23443 apache 4u IPv6 577098 TCP *:http (LISTEN)
httpd 23443 apache 6u IPv6 577103 TCP *:https (LISTEN)
httpd 23444 apache 4u IPv6 577098 TCP *:http (LISTEN)
httpd 23444 apache 6u IPv6 577103 TCP *:https (LISTEN)


Many Thanks in Advance You guys are A1 AWESOME!

x81kilo

stress_junkie 12-09-2010 12:59 PM

How about ps ax?
Code:

ps ax
This shows the full path of the binary running for each process. You can add more parameters to limit the display to particular users or program name.


All times are GMT -5. The time now is 09:20 AM.