linux: per-process monitor, every 10 minutes, with history access

Posted by Inbar Rose on Super User See other posts from Super User or by Inbar Rose
Published on 2012-12-04T13:43:04Z Indexed on 2012/12/05 23:07 UTC
Read the original article Hit count: 166

I really didn't know a better way to ask my question, hence you get a horribly named question.

I will explain what i want to do, maybe that will help you help me.

I would like to have my linux machine continuously monitor (every 10 minutes) all the processes on my machine. The information from each process that I require is the name, CPU usage, allocated (virtual) memory, and resident (ram) memory.

If these periodic reports were to be looked at, they would look something like this:

PROCESS    CPU    RAM    VIRTUAL
name1    %    MB    MB
name2    %    MB    MB
...etc..etc

These reports should be stored in such a way that I can access them at a later date by giving a date/time scope (range). For instance, if I want to see the history of my processes from 12:00:00 1.12.12 till 12:00:00 2.12.12 I can - and it should give me the history of the processes for every 10 minutes between those date/time borders.

The format of the return is not important, that will be handled by a script anyway and can be modified into anything I need.

I have looked into a few things so far, but have not found something that clearly meets my needs. Among the things i searched: sar, free(1), top(1).. and a few other things.

It should be a simple issue, i can already see all this information by simply looking at my htop, but i need only a tool that will gather the desired fields for me for each processes every 10 minutes, and then also let me extract slices of that data based on date/time scopes (ranges).

note: I have limited experience with linux, so please give detailed information.

note2: The desired output will be something like this (after receiving the desired range)

CPU USAGE BY PROCESS:
proc_nameA 1,2,2,2,2,2...... numbers represent % usage every 10 minutes...
proc_nameB 4,3,3,6,1,2......

The same idea with the other information.

© Super User or respective owner

Related posts about linux

Related posts about memory