Linux - monitoring processes

Handruin

Administrator
Joined
Jan 13, 2002
Messages
13,916
Location
USA
I'm currently working with Redhat 5.5 at work and there is some question and debate as to how accurate the different process monitoring tools are in gathering information. We've been using tools such as top, ps, free, and vmstat to collect information about general process usage. Are there better options that I should/could be using?

I'd like to collect the following detailed information at a periodic rate that is adjustable. The rate may range from 1 second to 30 seconds per polling. I'm looking to measure:

CPU time total
CPU % usage total
CPU % usage per process
RES memory per process
VIRT memory per process
Shared memory per process
Swap file usage

Right now I'm thinking about using the ps command and grep based on a list of processes I need to monitor. I will then format the output into a csv file that I can then later view inside a spreadsheet program such as Excel. Maybe something like:

'ps -eo pid,ppid,rss,vsize,pcpu,pmem,cmd -ww --sort=pid'
 

timwhit

Hairy Aussie
Joined
Jan 23, 2002
Messages
5,278
Location
Chicago, IL
Sounds like it will work fine. I would write a script to collect the data and create the CSV file automatically.

The Unix Sysadmin at my office uses Nagios to monitor our *nix boxes. I don't know if it would be helpful for this use case though.
 

blakerwry

Storage? I am Storage!
Joined
Oct 12, 2002
Messages
4,203
Location
Kansas City, USA
Website
justblake.com
you might also look at dstat - you can get it from rpmforge. I usually install dstat and htop right off.

Htop as a slightly better version of top and dstat because it gives great statistics that most tools otherwise overlook, such as per process io usage. dstat has a number of plugins that can monitor application specific performance as well - postfix, mysql, etc.
 
Top