1748176 Members
4265 Online
108758 Solutions
New Discussion юеВ

Re: Identify a process

 
SOLVED
Go to solution
Kalin Evtimov
Regular Advisor

Identify a process

Hi!
On my machine (Hp-ux 11.23) there is a perl-programm, which sometimes doesn't finish correctly (in my opinion), because it runs constantly with alsmost 100% of CPU-time. I would like to identify which programm starts, but I have no idea how to do this. How can I determine which programm was run by perl. As I am running webmin, I always get

1212:07 /opt/perl_64/bin/perl /usr/local/webmin-1.260/miniserv.pl /etc/

for any perl-programm run by webmin.

Thanks for any ideas!
12 REPLIES 12
Antonio Cardoso_1
Trusted Contributor

Re: Identify a process

if you see in top result that the perl programm is using 100% CPU, that means that it is not a process ran by this one, but the perl script itself...
Muthukumar_5
Honored Contributor

Re: Identify a process

Get the parent process ID.

# ps -ef | grep webmin

3rd field gives that.

--
Muthu
Easy to suggest when don't know about the problem!
Peter Godron
Honored Contributor

Re: Identify a process

Kalin,
what do you mean by "which program starts"?

To find the process taking the CPU: top
which should give you the PID

You can then use: ps -ef | grep PID_value
to get the ParentPID (second column).

Repeating this process will eventually lead you to the process that started all your sub-processes.
Kalin Evtimov
Regular Advisor

Re: Identify a process

Webmin's web server, which is written in perl, starts modules, also written in perl. The web severs' process is always the parent. But it is not the one, causing the problem. One of the procs started by webmin causes a problem, but I cannot identificate it, as they are run over the web server from webmin, which causes that all these perl-processes have the same name.
Antonio Cardoso_1
Trusted Contributor
Solution

Re: Identify a process

Don't these perl modules have any tracing/logging switches you could activate?
If not, maybe consider adding some?
Muthukumar_5
Honored Contributor

Re: Identify a process

If the process are started by webmin they will be using that as PPID.

# ps -ef | grep

will give all process which are started by it.

--
Muthu
Easy to suggest when don't know about the problem!
Muthukumar_5
Honored Contributor

Re: Identify a process

You can find which process is occupying more cpu resource as,

UNIX95=1 ps -ef -o cpu= -o pcpu= -o comm= -o pid | sort -rnk 2

or

top

will give that.

Hope webmin is maintaining a log file. Try to trace it.

--
Muthu
Easy to suggest when don't know about the problem!
Arunvijai_4
Honored Contributor

Re: Identify a process

Hello,

You can esily find out by giving,

# ps ef |grep -i perl

Also, You can download and install HP's Webmin which is fully supported on HP-UX/.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Arunvijai_4
Honored Contributor

Re: Identify a process

Hi Kalin,

You can download http://h20293.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=HPUXWSARCHIVE

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"