The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
how do I view a jpeg? dsstamps UNIX for Dummies Questions & Answers 0 05-14-2008 02:25 PM
How to view my IP blowFish@ubuntu UNIX for Dummies Questions & Answers 14 05-09-2008 10:35 AM
how to view my own process in a multiuser envrionment vishsid3 UNIX for Dummies Questions & Answers 4 11-15-2006 12:11 PM
view log files sak900354 UNIX for Dummies Questions & Answers 5 06-15-2006 08:26 AM
DBM View schafferm UNIX for Dummies Questions & Answers 1 08-06-2002 05:18 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-16-2008
taheri6 taheri6 is offline
Registered User
  
 

Join Date: Sep 2008
Posts: 3
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 (permalink)  
Old 09-16-2008
Ikon's Avatar
Ikon Ikon is offline Forum Advisor  
Registered User
  
 

Join Date: Jul 2008
Location: Phoenix, Arizona
Posts: 669
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 (permalink)  
Old 09-16-2008
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,763
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 (permalink)  
Old 09-16-2008
taheri6 taheri6 is offline
Registered User
  
 

Join Date: Sep 2008
Posts: 3
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 (permalink)  
Old 09-16-2008
avronius avronius is offline VIP Member  
VIP Member
  
 

Join Date: Apr 2008
Location: Calgary
Posts: 305
Try this
Code:
lsof -p <pid>
will provide you with lots of information about what this PID is using.
  #6 (permalink)  
Old 09-16-2008
frank_rizzo frank_rizzo is offline Forum Advisor  
Resident BOFH
  
 

Join Date: Dec 2007
Posts: 427
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 (permalink)  
Old 09-17-2008
taheri6 taheri6 is offline
Registered User
  
 

Join Date: Sep 2008
Posts: 3
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?
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:27 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0