view others process


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers view others process
# 1  
Old 09-16-2008
view others process

Hello,

I hope this is an easy question.

I have a few users who login through SSH and some times their bash session is using 100% cpu even though its been "idle" according to who for several days.

I would like to know what command the user ran in their bash session to peg the cpu out but am unsure how to do that.

Any assistance would be appreciated.
# 2  
Old 09-16-2008
To find users processes (This will also show cpu usage for the process):

man ps



use top to view processes you can then sort by the different columns, this will also show who started the process.
# 3  
Old 09-16-2008
Try putting this in /etc/profile
Code:
        TMOUT=14400
        readonly TMOUT
        export TMOUT

If the terminal is idle for 14400 seconds the session ends.

Have you tired lsof to see if there is a script being run?
# 4  
Old 09-16-2008
Hi,

Thank you both for your replies.

I did do a

Code:
 
ps auxf | cat

and it just showed me that Bash was running and using 100% cpu. It gave me pids and showed the owner but that didnt show me what they did.

I then took that user and ran an lsof but I didnt see any scripts running. Our cpu monitoring didnt start alerting until today, when the session was idle (according to w command) for 10 days
# 5  
Old 09-16-2008
Try this
Code:
lsof -p <pid>

will provide you with lots of information about what this PID is using.
# 6  
Old 09-16-2008
I would suggest attaching a debugger or generate a core file(kill -ABRT) and then analyze it.

or try use gdb/truss/strace/other stack utilities on the process to see where it is spinning.
# 7  
Old 09-17-2008
Thanks everyone for your ideas and advice, it is appreciated.


Im not terribly familiar with strace, I do see that I can do

Code:
strace -p <pid>

to trace through a running process, but I dont see a way to do that with a core dump

The only thing I see regarding a file at all is

Code:
strace -o <file>

which sends the output of strace to a file but nothing that would read in a dump - did I miss an option that is staring me in the face?
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. What is on Your Mind?

Moving from Desktop View to Mobile View

See attached video for a demo on how to move back and forth from the desktop view to the mobile view. Currently this only works for the home page, but I will work on some new PHP code in the future to make this work with the page we are currently on. Edit: The issue with making every page ... (2 Replies)
Discussion started by: Neo
2 Replies

2. UNIX for Dummies Questions & Answers

View User Mode Call Stack of Hung Process

I have a multithreaded usermode program(actually a daemon) which is in hanged state. To debug it I tried attaching the process to gdb, but the gdb hangs. gstack also gets hanged. I peeped into the proc file system and saw the process to be in sleeping state. /proc/sysrq-trigger I guess... (1 Reply)
Discussion started by: rupeshkp728
1 Replies

3. UNIX for Advanced & Expert Users

How to view Ramdisk Initialization Process

Dear all, I read some articles about initrd, but how to view this process in my computer :(? Is there anyway to display to the screen or write to the log file? (3 Replies)
Discussion started by: Hannibal2010
3 Replies

4. Solaris

Need to view all DB

Hi Gurus, How to view only a database files on solaris. Please do a reply at the earliest. Thanks | P.Bharathiraja (2 Replies)
Discussion started by: bharathiraja
2 Replies

5. Shell Programming and Scripting

Shell Script to Kill Process(number of process) Unix/Solaris

Hi Experts, we do have a shell script for Unix Solaris, which will kill all the process manullay, it used to work in my previous env, but now it is throwing this error.. could some one please help me to resolve it This is how we execute the script (and this is the requirement) ... (2 Replies)
Discussion started by: jonnyvic
2 Replies

6. Shell Programming and Scripting

script to monitor process running on server and posting a mail if any process is dead

Hello all, I would be happy if any one could help me with a shell script that would determine all the processes running on a Unix server and post a mail if any of the process is not running or aborted. Thanks in advance Regards, pradeep kulkarni. :mad: (13 Replies)
Discussion started by: pradeepmacha
13 Replies

7. UNIX for Advanced & Expert Users

View process history

Hi, Is there any way to view process history. Suppose I had killed a few procs yesterday and now I want to see what were the procs that were running yesterday? (2 Replies)
Discussion started by: King Nothing
2 Replies

8. UNIX for Dummies Questions & Answers

How to view my IP

I run Ubuntu server 7.04, to learn some *nix. I set up LAMP, DNS and FTP but I don't know how to view my ip. now I tried ifconfig but that didnt tell me what I wanted to know. so by what way can I do this without a gui and a website like ipchicken? (14 Replies)
Discussion started by: blowFish@ubuntu
14 Replies

9. UNIX for Dummies Questions & Answers

how to view my own process in a multiuser envrionment

Hi , I am new to unix , tell me how can I check which all are the processes which were started by me or under my account , its a multiuser enviornment , I tried with ps -f , but it does not give me the complete answer , it gives me which shells I hv opened like tht , I want the processes like ... (4 Replies)
Discussion started by: vishsid3
4 Replies
Login or Register to Ask a Question