Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have to generate reports for the following :

1- cpu usage. 2- memory usage.

The generated reports must be looks like the following forms :

enter image description here

enter image description here

I've tried with more than one command to get system readings ... such as htop, atop and dstat -ta --top-cpu

The result for htop was :

enter image description here

The result for atop was:

enter image description here

The result for dstat was :

enter image description here

which is the correct command should I use to gather the correct system readings in which I can calculate the average value,min value,max value,median value and deviation for the cpu usage,memory usage,open files count and open ports count as in the first and second picture ?

If any one can help me to decide the appropriate command ...I hope if he can also tell me what the important numbers from the resulting system readings should I take to calculate the columns in the first two pictures ?

The data must be stored in a database that consists of a specific tables while the reports can be generated with the help of a java application which is responsible to deal with the database and use the retrieved data to make calculations and generate reports ... now I'm trying to make the database model so I need to know the necessary columns in the tables so I need your help to start the actual work for me which is the java application ... just I want to know what data should I take in my consideration !

share|improve this question
up vote 1 down vote accepted

You can use

cat /proc/loadavg

That gives you the 3 load average numbers for the period 1, 5, and 15 minutes.

Then the number of currently running processes and then the pid of the last called process.

I don't know what you mean with the median and deviation values.

But hopefully this is a start for you.

cat /proc/meminfo

gives you memory stats.

The /proc directory could give you more infos for your needs. Just cat /proc/xxxx the file you are interested in.


is just a programm to show the contents of a file to your termial. Jo can use your javaprogramm or whatever to read those files and send the values to your database.

share|improve this answer
what the 3 avg values refers to ?? thanks for ur help :)) – Akari Feb 13 '14 at 22:01
I have edited the answer to make it clearer. – rechengehirn Feb 13 '14 at 22:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.