Operating System - HP-UX
1838687 Members
6302 Online
110128 Solutions
New Discussion

process table checking. Who/What/When

 
SOLVED
Go to solution
jerry1
Super Advisor

process table checking. Who/What/When

Would anyone out there happen to have a
script or would know how to capture particular
user account processes and log them.

ps -ef gives you the current snapshot of what
is running but how would you capture particular
process in real time to a log file without
have dups entires minus the ones that you know
you don't want logged.

Doing a:

ps -ef|grep -v |grep -i >>pslog

doesn't give you realtime uniq data.

acctcom does not have the info needed either.
9 REPLIES 9
RAC_1
Honored Contributor

Re: process table checking. Who/What/When

ps -lxu "user_name"

-l long listing
-x extended command line
-u user name

Check
ps -xu "user_name"
ps -lu "user_name"

Hope this helps.
There is no substitute to HARDWORK
RAC_1
Honored Contributor

Re: process table checking. Who/What/When

You can also do as follows.
export UNIX95=1

UNIX95= ps -u "user_name" -o "uid,args,stime"

Will give you uid of user, command being run and start time. When process start time is more than 24 hrs, it will only shoe start date.

You can provide lot of flags with -o options. Check man page of ps for details.
There is no substitute to HARDWORK
Sridhar Bhaskarla
Honored Contributor

Re: process table checking. Who/What/When

Hi,

If you want to capture a particular user account processes, then I would use XPG4 with -u option.

UNIX95= ps -fu user -o "vsz args"

to print the argument and the vsz corresponding to the processes owned by the user 'user'.

Look at ps man page for more options.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
jerry1
Super Advisor

Re: process table checking. Who/What/When

Could someone explain what UNIX95 is?
I keep seeing this mentioned in various
email messages but never found a reference in
the man pages.

Sri, what is XPG4?


Paula J Frazer-Campbell
Honored Contributor
Solution

Re: process table checking. Who/What/When

Hi

Unix95 info:-

http://ou800doc.caldera.com/DIFFS/UNIX95_Conformance.html

Paula
If you can spell SysAdmin then you is one - anon
Paula J Frazer-Campbell
Honored Contributor

Re: process table checking. Who/What/When

Jerry

And Here:-

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=4177

Paula
If you can spell SysAdmin then you is one - anon
florence mathon lermusi
Trusted Contributor

Re: process table checking. Who/What/When

hi,

perhaps you can use some HP tools like PRM, glance or Measureware to look at your users consumption...
Steve Steel
Honored Contributor

Re: process table checking. Who/What/When

Hi

Something like

echo $_
user=$1
echo " $(UNIX95= ps -e -o pcpu -o ruser -o sz -o vsz -opid -oppid -otty -o args
|head -n1)"
UNIX95= ps -e -o pcpu -o ruser -o sz -o vsz -opid -oppid -otty -o args|grep -v %CPU| sort -nr|tail -n +2|head -n 20|grep " "$user

If you want to log more then use top with the undocumented -f logfile option

Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
jerry1
Super Advisor

Re: process table checking. Who/What/When

It's my fault. I need to start explaining
better the requirements of what is needed.

Lets say you want to monitor the oracle id
to see what is being run as oracle other
than the current oracle processes running.
The current running processes are in your
exclude list so you don't have to worry about
them. It's any other oracle processes that
may pop up that you want to question.
So, you want to somehow capture these processes, even if they only run for a few seconds and log them to a file that you can
review from time to time. Basically the tty,
the time executed and the command is all that
would be needed. Since we already know it is
oracle user.

Steve, I tried the undocumented top -l option. No go. Unless you are referring to the good downloaded version, not the HP one.

Mathon, we have glance and measureware but
unless I don't understand how to capture
what oracle is running at any one time with
these tools. I can't use it.

What is PRM?

Is there a /proc directory like on Sun somewhere on HP?