How to see what scripts are raising CPU usage?

Is there way via SSH (or WHM, if it has that functionality) to view specifically what files/scripts are causing the server CPU to be so high? For the past few days my server has been going offline a lot and all my server management will tell me is that there are processes taking up too much of the CPU, but in WHM I can only view CPU usage by account, not by specific file or process.

Thanks!

Just use “top(1)” command line utility

Yes, you can monitor the CPU usage using top -c command from your SSH.

If you have root access try SSH command : top -d 2
then press C

Hello,

From SSh, just run following command.
ps -eo pcpu,pid,user args | sort -n | uniq -c | head -5

It will show you five high cpu consuming processes.
If you see any php page consuming high resources, then just run
lsof -p <pid>

It will show you path of php script.

You can also run ps uaxww in order to see if there are any suspicious tasks (top command lists tasks sorted by resources usage, and not all tasks get listed)