1834208 Members
2312 Online
110066 Solutions
New Discussion

processes

 
SOLVED
Go to solution
Satish Y
Trusted Contributor

processes

Hi All,

Greetings for the day!

I want to know, in HP-UX whether it contains any directory which contains process status of currently running processes. Like /proc/###/ in solaris(### -- pid, -- wfile that contains what r all processes associated with it)....
If not, can we configure our Unix box for doing above?.. and how?...

Cheers...
Satish.
Difference between good and the best is only a little effort
5 REPLIES 5
eran maor
Honored Contributor
Solution

Re: processes

Hi

File utmp contains a record of all users logged onto the system. File
btmp contains bad login entries for each invalid logon attempt. File
wtmp contains a record of all logins and logouts.

if you want to trace a process from the start here is a nice program that i found that could help you to trace a process

Here is an example of monitoring the status of a process from beginning
to end. 'read_acct.c' is the name of the source file.

Note: This example was used to track a cron process, but you can
modify the 'grep' to extract other process names:

1a. Download the read_acct.c source file via anonymous ftp.
It is available via anonymous ftp from hppine34.uksr.hp.com
in the /pub/ directory.

Take a look at the header file usr/include/sys/acct.h and
the acct structure therein to see what fields are held in
each record. You may wish to modify the program to print
out some other fields of interest.

1b. Compile the read_acct executable from the read_acct.c
source file:

cc -o read_acct read_acct.c

2. Turn on accounting:

# touch /[filesystem_with_space]/pacct
# /usr/lib/acct/accton /[filesystem_with_space]/pacct

Note: The 'pacct' file stores all of the Accounting data,
and this file can grow quite large. It would be wise
to monitor the size of this file, and to store this
file on a NON-ROOT file system. The size of the file
will vary from system to system.

You will leave accounting ON for some period of time
in order to log the data that you are attempting to
capture.

3. Turn off accounting:

# /usr/lib/acct/accton

4. Run the read_acct program to interpret the pacct file:

# ./read_acct /[filesystem_with_space]/pacct | grep cron
read_acct pacct |grep cron > read_acct_1
love computers
Carsten Krege
Honored Contributor

Re: processes

No, there doesn't exist a /proc filesystem on HPUX. Use tools like glance to get verbose process information.

Carsten
-------------------------------------------------------------------------------------------------
In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move. -- HhGttG
Satish Y
Trusted Contributor

Re: processes

Eran, Thanks!
Is it /etc/utmp?... how to get info from it?.. is there any cmd like last for wtmp and lastb for btmp....
Satish.
Difference between good and the best is only a little effort
Satish Y
Trusted Contributor

Re: processes

OK Eran, I got it... who cmd uses it.... right?.

Cheers...
Satish.
Difference between good and the best is only a little effort
eran maor
Honored Contributor

Re: processes

Hi Satish

yep, you are rigth , the cmd who used the utmp
and the cmd last command used the wtmp
love computers