I want to get statistic hourly by used averages resources per user such as cpu and memory. How I can get it?
Asked
Active
Viewed 3,487 times
1 Answers
0
http://linux.die.net/man/1/sar
SAR to the rescue
You can get activity reports with this linux command. I especially like this article showing different usages:
http://www.thegeekstuff.com/2011/03/sar-examples/
Or, per user, you can use sa:
http://www.gnu.org/software/acct/manual/html_chapter/accounting_6.html#SEC20
$ sa --user-summary
23 0.13re 0.01cp 0avio 3163k
root 9 0.13re 0.01cp 0avio 3588k
ssperandeo 3 0.00re 0.00cp 0avio 1467k
rabbitmq 10 0.00re 0.00cp 0avio 1020k
postgres 1 0.00re 0.00cp 0avio 25856k

Homer6
- 221
- 2
- 7
-
Thnx, but I don't see how I can show it **per user** – Nov 20 '12 at 17:45
-
Updated to address user-specific queries. – Homer6 Nov 20 '12 at 17:53
-
This command output result for all time (since last reboot)? – Nov 20 '12 at 17:58
-
All time. It saves it to a file. – Homer6 Nov 20 '12 at 18:02
-
A lot of thanx! – Nov 20 '12 at 18:18
-
Have a problem.From man: sa summarizes information about previously executed commands as recorded in the acct file. But what about execute now program? For example, nodes? How can I view information about not complete process? – Devoll Nov 22 '12 at 14:51