Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 13345  / 2 Years ago, sat, june 4, 2022, 10:37:36

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 !


More From » 12.04

 Answers
5

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.


[#27023] Sunday, June 5, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ampolinhad

Total Points: 88
Total Questions: 100
Total Answers: 116

Location: South Georgia
Member since Tue, Feb 1, 2022
2 Years ago
ampolinhad questions
Thu, Sep 8, 22, 15:45, 2 Years ago
Tue, Aug 10, 21, 20:03, 3 Years ago
Sat, Oct 16, 21, 22:44, 3 Years ago
Sat, Oct 23, 21, 03:11, 3 Years ago
Thu, Nov 17, 22, 15:34, 1 Year ago
;