6

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 !

2 Answers 2

4

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.

cat

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.

2
  • 1
    what the 3 avg values refers to ?? thanks for ur help :))
    – Akari
    Feb 13, 2014 at 22:01
  • 1
    I have edited the answer to make it clearer. Feb 13, 2014 at 22:04
0

Although the post is old, i am answering for the benefit of others in need. Following can be used "dstat -tcmndylp --top-cpu" can be used to calculate the cpu/memory usage etc. You can check the man pages too for dstat columns meaning.

Find avg and then find the sd.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .